Beispiel #1
0
        // Use this for initialization
        void Start()
        {
            bloom = gameObject.AddComponent <Bloom>();
            bloom.bloomIntensity = 0.8f;
            bloom.bloomThreshold = 0.8f;

            bloom.lensFlareVignetteMask  = bloomLensFlareVignetteMask;
            bloom.lensFlareShader        = bloomLensFlareShader;
            bloom.screenBlendShader      = bloomScreenBlendShader;
            bloom.blurAndFlaresShader    = bloomBlurAndFlaresShader;
            bloom.brightPassFilterShader = bloomBrightPassFilter;

            blur               = gameObject.AddComponent <CameraMotionBlur>();
            blur.filterType    = CameraMotionBlur.MotionBlurFilter.LocalBlur;
            blur.velocityScale = 1;
            blur.maxVelocity   = 1000;
            blur.minVelocity   = 0.1f;

            blur.shader = motionBlurShader;
            blur.dx11MotionBlurShader = motionBlurDX11Shader;
            blur.replacementClear     = motionBlurReplacementClearShader;
            blur.noiseTexture         = motionBlurNoiseTexture;

            if (ActiveData.ESportsFullyReady)
            {
            }

            EnableEffects();
        }
Beispiel #2
0
    void Start()
    {
        instance = this;

        // cache references to our player and level manager objects
        player       = GameObject.FindObjectOfType <PlayerControl>();
        levelManager = GameObject.FindObjectOfType <LevelManager>();

        // cache some references to various menu screens and so on
        menuSystem  = GameObject.FindObjectOfType <MenuSystem>();
        mainMenu    = menuSystem.GetScreen("MainMenu");
        pauseMenu   = menuSystem.GetScreen("PauseMenu");
        restartMenu = menuSystem.GetScreen("RestartMenu");
        storeMenu   = menuSystem.GetScreen("StoreMenu");
        screenFade  = GameObject.Find("ScreenFade").GetComponent <CanvasGroup>();
        infoPopup   = GameObject.FindObjectOfType <InfoPopup>();

        // find our full screen effects
        motionBlur = GameObject.FindObjectOfType <CameraMotionBlur>();
        screenBlur = GameObject.FindObjectOfType <BlurOptimized>();

        // start with the screen fader opaque
        screenFade.alpha = 1.0f;

        creditMultiplier = 1.0f;

        CheckShopItemIDs();
        InitFullscreenEffects();

        OnEnterStateMenus();
    }
Beispiel #3
0
 private void Awake()
 {
     current = this;
     bloom   = GetComponent <Bloom>();
     vignetteAndChromaticAberration = GetComponent <VignetteAndChromaticAberration>();
     cameraMotionBlur = GetComponent <CameraMotionBlur>();
 }
Beispiel #4
0
        /// <summary>
        /// Starts a seperate thread for taking care of shaking
        /// the camera.
        /// </summary>
        /// <returns>IEnumerator.</returns>
        /// <param name="amountOfDamage">Amount of damage.</param>
        /// <param name="blur">Blur object for animation</param>
        private IEnumerator AnimateTakingDamage(int amountOfDamage, CameraMotionBlur blur)
        {
            blur.velocityScale = 34;
            yield return(new WaitForSeconds(.5f));

            blur.velocityScale = 0;
        }
Beispiel #5
0
    void Start()
    {
        _blur = FindObjectOfType <CameraMotionBlur>();
        if (PlayerPrefs.GetInt("Soundtrack") == 0)
        {
            tracks[Random.Range(0, 14)].Play();
            // LoadAstBundleLevelLap.manage.track12_isLoaded.GetComponentInChildren<AudioSource>().volume = 0.782f;
            // LoadAstBundleLevelLap.manage.track15_isLoaded.GetComponent<AudioSource>().volume = 0.7f;
            //  LoadAstBundleLevelLap.manage.track13_isLoaded.GetComponentInChildren<AudioSource>().volume = 0.25f;
            // AudioSource[] _tracks = new AudioSource[] { tracks[1], tracks[2], tracks[3], tracks[4], tracks[5], tracks[6], LoadAstBundleLevelLap.manage.track11_isLoaded.GetComponent<AudioSource>(),
            // LoadAstBundleLevelLap.manage.track12_isLoaded.GetComponent<AudioSource>(), LoadAstBundleLevelLap.manage.track13_isLoaded.GetComponent<AudioSource>(), LoadAstBundleLevelLap.manage.track14_isLoaded.GetComponent<AudioSource>(),
            // LoadAstBundleLevelLap.manage.track15_isLoaded.GetComponent<AudioSource>(),LoadAstBundleLevelLap.manage.track16_isLoaded.GetComponent<AudioSource>(), LoadAstBundleLevelLap.manage.track17_isLoaded.GetComponent<AudioSource>(),
            //LoadAstBundleLevelLap.manage.track18_isLoaded.GetComponent<AudioSource>()};
            //  _tracks[Random.Range(0, _tracks.Length)].Play();
            //  print(Random.Range(0, _tracks.Length));
        }

        if (SceneManager.GetActiveScene().name == "city_single" || SceneManager.GetActiveScene().name == "city_online")
        {
            if (PlayerPrefs.GetInt("Soundtrack") == 1)
            {
                tracks[7].Play();
            }
        }
        PausePanel.SetActive(false);
    }
Beispiel #6
0
    // Use this for initialization
    void Awake () {
        motionBlur = GetComponent<CameraMotionBlur>();
        pod = (GameObject.FindGameObjectWithTag("Player")).GetComponent<DropPod>();

        // Make sure that the velocity starts at zero
        motionBlur.velocityScale = 0;

    }
Beispiel #7
0
    void Start()
    {
        maxCameraDistance     = cameraTransform.localPosition.magnitude;
        currentCameraDistance = maxCameraDistance;
        cameraDirection       = cameraTransform.localPosition.normalized;
        desiredCameraPosition = cameraRigRoot.TransformPoint(maxCameraDistance * cameraDirection);

        cameraMotionBlur = cameraTransform.gameObject.GetComponent <CameraMotionBlur>();
    }
Beispiel #8
0
 void Awake()
 {
     vignetteFilter       = gameObject.GetComponent <VignetteAndChromaticAberration>();
     noiseFilter          = gameObject.GetComponent <NoiseAndScratches>();
     blurFilter           = gameObject.GetComponent <CameraMotionBlur>();
     bloomFilter          = gameObject.GetComponent <Bloom>();
     maxVignetteIntensity = lightVignetteIntensity;
     vignetteSpeed        = lightVignetteSpeed;
 }
Beispiel #9
0
    void Start()
    {
        player   = FindObjectOfType <Player>();
        theLight = FindObjectOfType <TheLight>();

        blur       = GetComponent <Blur>();
        bloom      = GetComponent <Bloom>();
        twirl      = GetComponent <Twirl>();
        camera     = GetComponent <Camera>();
        shafts     = GetComponent <SunShafts>();
        motionBlur = GetComponent <CameraMotionBlur>();
    }
Beispiel #10
0
    void Start()
    {
        m_cam = Camera.main;
        m_sunShafts = m_cam.GetComponent<SunShafts>();
        m_bloom = m_cam.GetComponent<Bloom>();
        m_motionBlur = m_cam.GetComponent<CameraMotionBlur>();
        m_antiAliasing = m_cam.GetComponent<AntiAliasing>();
        m_colorGrading = m_cam.GetComponent<TonemappingColorGrading>();

        m_defaultGrading = m_colorGrading.colorGrading;

        GameController.GameOver += OnGameOver;
    }
        public bool Update(Transform camera, CameraMotionBlur motionBlurEffect)
        {
            float expiredTime = Time.time - startTime;
            float progress    = Mathf.Clamp01(expiredTime / duration);

            if (expiredTime >= duration)
            {
                return(false);
            }
            camera.position += GetDeviation(progress);
            float blur = motionBlur * (1f - progress) * maxBlur;

            motionBlurEffect.velocityScale = Mathf.Min(maxBlur, motionBlurEffect.velocityScale + blur);
            return(true);
        }
Beispiel #12
0
        /// <summary>
        /// Creates a copy of a target camera parented under that camera.
        /// </summary>
        static void CreateCopy(Camera TargetCam)
        {
            GameObject NewObj = new GameObject();

            NewObj.transform.parent           = TargetCam.gameObject.transform;
            NewObj.transform.localPosition    = new Vector3(-EyeDistance, 0, 0);
            NewObj.transform.localEulerAngles = new Vector3(0, EyeRotation, 0);
            float FovExtension = Screen.width / (float)Screen.height;

            TargetCam.fieldOfView      *= FovExtension;
            TargetCam.orthographicSize *= FovExtension;
            TargetCam.rect              = new Rect(.5f, 0, .5f, 1);
            Camera OtherEye = (Camera)CopyComponent(TargetCam, NewObj);

            OtherEye.rect = new Rect(0, 0, .5f, 1);
            // Copy skybox and effects
            Skybox Sky = TargetCam.gameObject.GetComponent <Skybox>();

            if (Sky)
            {
                CopyComponent(Sky, NewObj);
            }
            DepthOfField DoF = TargetCam.gameObject.GetComponent <DepthOfField>();

            if (DoF)
            {
                CopyComponent(DoF, NewObj);
            }
            CameraMotionBlur Blur = TargetCam.gameObject.GetComponent <CameraMotionBlur>();

            if (Blur)
            {
                CopyComponent(Blur, NewObj);
            }
            // Group
            OtherEyes.Add(OtherEye);
            if (TargetCam == Camera.main)
            {
                OtherMain = OtherEye;
            }
        }
 // Use this for initialization
 void Start()
 {
     motionBlurScript = cam.GetComponent ("MotionBlur") as MotionBlur;
     cameraMotionBlurScript = cam.GetComponent ("CameraMotionBlur") as CameraMotionBlur;
 }
 void Start()
 {
     this.cameraMotionBlur = this.GetComponent<CameraMotionBlur>();
 }
Beispiel #15
0
 void Awake() {
     blur = FindObjectOfType<CameraMotionBlur>();
     dof = FindObjectOfType<DepthOfField>();
     musicPlayer = GameObject.Find("MusicPlayer").GetComponent<AudioSource>();
 }
Beispiel #16
0
    void Start()
    {
        maxCameraDistance = cameraTransform.localPosition.magnitude;
        currentCameraDistance = maxCameraDistance;
        cameraDirection = cameraTransform.localPosition.normalized;
        desiredCameraPosition = cameraRigRoot.TransformPoint(maxCameraDistance * cameraDirection);

        cameraMotionBlur = cameraTransform.gameObject.GetComponent<CameraMotionBlur>();
    }
 void Start()
 {
     mainCamera       = Camera.main.transform;
     motionBlurEffect = ImageEffectsManager.current.cameraMotionBlur;
 }
Beispiel #18
0
 void Start()
 {
     motionBlur = GetComponent<CameraMotionBlur>();
     if(motionBlur)
         motionBlur.enabled = false;
 }
 public CameraMotionBlurSample(Microsoft.Xna.Framework.Game game)
     : base(game)
 {
     _cameraMotionBlur = new CameraMotionBlur(GraphicsService);
     GraphicsScreen.PostProcessors.Add(_cameraMotionBlur);
 }
Beispiel #20
0
    // Instantiate variables and references here
    void Awake()
    {
        // Initialize the manager objects
        Instance = this;
        player = GameObject.FindObjectOfType<Player>();
        levelManager = GameObject.FindObjectOfType<LevelHandler>();

        // Initialize all UI menu object references
        menuManager = GameObject.FindObjectOfType<MenuHandler>();
        mainMenu = menuManager.getMenu("MainMenuScreen");
        pauseMenu = menuManager.getMenu("PauseScreen");
        restartMenu = menuManager.getMenu("ResetScreen");
        storeMenu = menuManager.getMenu("StoreScreen");
        creditsMenu = menuManager.getMenu("CreditsScreen");
        leaderboardMenu = menuManager.getMenu("LeaderboardScreen");
        menuFader = GameObject.Find("CanvasTransition").GetComponent<CanvasGroup>();
        displayBoard = GameObject.FindObjectOfType<DisplayUI>();

        // Initialize full screen effects here
        cameraMotionBlur = GameObject.FindObjectOfType<CameraMotionBlur>();

        // Fader UI object visible on start
        menuFader.alpha = 1.0f;

        // Initialize default game state
        moneyMultiplier = 1.0f;
        distanceRecord = 500.0f;
        initializeCameraEffects();
        initializeMainMenu();
    }