private void Update() { if (!paused) { if (UI.PauseMenu.GamePaused) { paused = true; blur = gameObject.AddComponent <BlurOptimized>(); blur.downsample = 1; blur.blurSize = 0; blur.blurIterations = 3; blur.blurType = BlurOptimized.BlurType.StandardGauss; blur.blurShader = shader; } } else { if (blur.blurSize < targetBlurSize) { blur.blurSize = Mathf.Min(blur.blurSize + Time.unscaledDeltaTime * 40, targetBlurSize); } if (!UI.PauseMenu.GamePaused) { paused = false; Destroy(blur); } } }
private void Awake() { isPaused = false; pauseEvent = Pause; gameOverEvent = GameOver; tutorialText = TutorialText; getTutorialIndex = GetTutorialIndex; musicOn = music.transform.GetChild(1).gameObject; musicOff = music.transform.GetChild(2).gameObject; soundOn = sound.transform.GetChild(1).gameObject; soundOff = sound.transform.GetChild(2).gameObject; musicOn.SetActive(Utils.Music >= 0); musicOff.SetActive(Utils.Music < 0); soundOn.SetActive(Utils.Soundfx >= 0); soundOff.SetActive(Utils.Soundfx < 0); sensitivitySlider.value = Utils.Sensitivity; pause.onClick.AddListener(Pause); resume.onClick.AddListener(Pause); menu.onClick.AddListener(Menu); menu2.onClick.AddListener(Menu); again.onClick.AddListener(Again); sound.onClick.AddListener(ToggleSound); music.onClick.AddListener(ToggleMusic); sensitivitySlider.onValueChanged.AddListener(ChangeSensitivity); blur = Camera.main.GetComponent <BlurOptimized>(); tutorialTexts = tutorial.GetComponentsInChildren <FadeableUI>(); tutorialIndex = 0; }
// Use this for initialization void Start() { blur = GetComponentInChildren <BlurOptimized>(); blur.enabled = false; clip = vibration; instance = this; }
private void InitFullscreenEffects() { if (motionBlur != null) { // because our camera stays stationary whilst the geometry scrolls past, the normal calculation of // camera motion blur won't work. Instead we use the 'preview' mode to simulate a particular camera velocity. motionBlur.preview = true; motionBlur.previewScale = Vector3.zero; if (Application.isMobilePlatform && disableMotionBlurOnMobile) { motionBlur.enabled = false; } } if (screenBlur != null && Application.isMobilePlatform && disableMenuBlurOnMobile) { screenBlur.enabled = false; screenBlur = null; } // antialiasing is expensive, and not really necessary on mobile due to the much higher dpi Antialiasing aaFilter = GameObject.FindObjectOfType <Antialiasing>(); if (aaFilter != null && Application.isMobilePlatform) { aaFilter.enabled = false; } }
public void BeginBlur() { Debug.Log("Begun fading blur"); blur = GetComponent<BlurOptimized>(); blur.enabled = true; InvokeRepeating("BlurFade", 0, 0.01f); }
// Question Answering Pipeline: // +--------------+ // capture question -> gather data -> | ANALYZE DATA | // +--------------+ void Start() { int i; LoadingTextScript.textAsStringArray = new string[] { "A", "N", "A", "L", "Y", "Z", "I", "N", "G" }; // Initialize Eeeeeverything for (i = 0; i < 3; i++) { methodNumbers[i] = new float[3]; sortedMethodNumbers[i] = new float[3]; displayMethodNumbers[i] = new float[3]; currentDisplayMethodNumbers[i] = new float[3]; rawNumbersRef[i] = new float[3]; rawNumberGraphics[i] = new Image[3]; rawNumberText[i] = new Text[3]; } popularWords = popularWordListText.text; loadingAnimationMat = loadingAnimation.GetComponent <Renderer>().material; blurScript = GetComponent <BlurOptimized>(); // The two lines of code below (lines 100-101) is the scrapped multithreading code. // All you would have to do is uncomment lines 100-101 and comment out line 102 and the code would be multithreaded. // However, while this leads to smoother visuals and less studdering at runtime, it actually executes ~2 seconds slower than // simply putting the burden on the main thread, so it's disabled here. The same goes when multithreading GatherDataSctipt. // The code remains here for a case in point. If you want to see for yourself, have a go at it! "ANALYZING" will be smooth! //Thread myThread = new Thread(GenerateAnswerData); //myThread.Start(); GenerateAnswerData(); }
void Start() { myTransform = transform; myCamera = myTransform.Find("Camera").GetComponent <Camera>(); blur = myCamera.GetComponent <BlurOptimized>(); flash = myTransform.parent.Find("GUI/Effects/Flash").GetComponent <Image>(); // Add list of zooms zoom.Add(5.0f); zoom.Add(10.0f); zoom.Add(20.0f); zoom.Add(30.0f); zoom.Add(50.0f); // Add list of rotates rotate.Add(0.0f); rotate.Add(120.0f); rotate.Add(240.0f); // Default tilt cameraTiltPosition = cameraTiltPositionDefault; cameraTiltRotation = cameraTiltRotationDefault; // Default camera bounds cameraMaxZ = mapMaxZ; cameraMinZ = mapMinZ; cameraMaxX = mapMaxX; cameraMinX = mapMinX; }
public void OnEvent(Events.BuildingSelectionConfirmedEvent e) { if (lastSelectedBuilding != null) { // TODO: Instantiate without position leads to flickering around zero origin when display shows up GameObject display = GameObject.Instantiate(displayPrefab); display.GetComponent <DisplayBehaviour>().SetData(lastSelectedBuilding, lastSelectedBuildingPosition, VRTK_DeviceFinder.HeadsetTransform()); //VRTK_DeviceFinder.GetControllerRightHand().GetComponent<VRTK_ControllerActions>().ToggleHighlightTouchpad(false); EventBus.Post(new ChangeInteractionConceptEvent(InteractionConcept.Idle)); Hint.Confirm("BuildingSelectionConfirmHint"); Hint.Confirm("BuildingSelectionHint"); Hint.Confirm("BuildingSelectionTriggerHint"); } if (selectionOnFloor) { BlurOptimized blur = VRTK_DeviceFinder.HeadsetCamera().GetComponent <BlurOptimized>(); blur.enabled = true; Transform playArea = VRTK_DeviceFinder.PlayAreaTransform(); Hint.Confirm("HowToNavigateHint"); AnimateThis playAreaAnimation = playArea.GetComponent <AnimateThis>(); playAreaAnimation.CancelAll(); playAreaAnimation.Transformate() .ToPosition(lastSelectedFloorPosition) .Duration(0.2f) .Ease(AnimateThis.EaseInQuintic) .OnEnd(OnNavigationAnimationComplete) .Start(); } }
private void Start() { prevFrameDrunkLvl = drunkValToDrunkLvl(flowchart.GetIntegerVariable("drunkLvl")); blur = mainCamera.GetComponent <BlurOptimized>(); var postProcessingBehaviour = mainCamera.GetComponent <PostProcessingBehaviour>(); chromaticAberration = postProcessingBehaviour.profile.chromaticAberration; chromaticAberration.enabled = false; SetChromaticAberrationIntensity(0f); vignette = postProcessingBehaviour.profile.vignette; vignette.enabled = false; SetVignetteIntensity(0f); var s = vignette.settings; s.smoothness = defaultVignetteSmoothness; s.roundness = defaultVignetteRoundness; vignette.settings = s; if (girl != null) { girl.key = "plump"; } }
void Start() { offPathClip = Resources.Load("Audio/WrongWay") as AudioClip; inValidZone = true; speaker = FindObjectOfType <FollowPlayer>().GetComponent <AudioSource>(); blur = FindObjectOfType <BlurOptimized>(); }
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(); }
private void IosStart() { Instance = this; SCameraManager.CreateCamera(SCameraType.EASYAR); GameObject Gyro = new GameObject(); Gyro.name = "GyroController"; Gyro.AddComponent <MySkyGyroController>(); Gyro.transform.SetParent(GameObject.Find("Manager").gameObject.transform); Gyro.transform.localPosition = Vector3.zero; SCameraManager.currentCamera.gameObject.transform.SetParent(Gyro.transform); m_BlurOptimized = SCameraManager.currentCamera.camera.gameObject.GetComponent <BlurOptimized>(); m_SUILoading = SUILoading.CreateLoading(); Start3D = PlayerPrefs.GetInt("3DStart"); Start3D++; PlayerPrefs.SetInt("3DStart", Start3D); // PlayerPrefs.SetInt("GUIDE3D", 1); MsgBase.MsgAdd <string>("OnOpenScene", OnOpenScene); MsgBase.MsgAdd <string, Callback>("RemoveScene2", RemoveScene2); MsgBase.MsgAdd <string>("RemoveScene", RemoveScene1); MsgBase.MsgAdd("RemoveTutorial", RemoveTutorial); MsgBase.MsgAdd <string>("HideScene", HideScene); MsgBase.MsgAdd <bool, float>("ShowBlur", ShowBlur); OnOpenScene("UI"); if (PlayerPrefs.GetInt("GUIDE3D") == 3) { OnOpenScene("PhotoScene"); } }
public static void FadeBlur(BlurOptimized blurEff, float startValue = 0, float targetValue = 0) { if (blurEff == null || instance == null) { return; } instance.StartCoroutine(instance.FadeBlurRoutine(blurEff, startValue, targetValue)); }
// Use this for initialization void Start() { gc = gameObject.GetComponent <GameController>(); blurOptimized = GetComponent <BlurOptimized>(); blurOptimized.blurSize = Random.Range(1.5f, 6.5f); blurSizeVal = blurOptimized.blurSize; }
// Use this for initialization void Start() { // もしアタッチしてなかったら、代入 if (null == BlurOptim) { BlurOptim = GetComponent <BlurOptimized>(); } }
void Awake() { Instance = this; _fisheye = playerCamera.gameObject.GetComponent<Fisheye>(); _colorSaturation = playerCamera.gameObject.GetComponent<ColorCorrectionCurves>(); _blur = playerCamera.gameObject.GetComponent<BlurOptimized>(); }
// Use this for initialization void Start() { gc = gameObject.GetComponent<GameController>(); blurOptimized = GetComponent<BlurOptimized>(); blurOptimized.blurSize = Random.Range(1.5f, 6.5f); blurSizeVal = blurOptimized.blurSize; }
private void OnEnable() { gameLogic = GameObject.Find("GameLogic").GetComponent <GameLogic>(); blur = camera.GetComponent <BlurOptimized>(); gameLogic.Drunkness = gameLogic.StartDrunk; SetSliderValue(gameLogic.StartDrunk / gameLogic.End); }
void Start() { soundController = GameObject.Find("Sound_Controller").GetComponent<SoundController>(); blur = Camera.main.GetComponent<BlurOptimized>(); blur.blurSize = 0; blur.blurIterations = 1; blur.enabled = false; }
void Start() { blurEffect = GetComponent <BlurOptimized>(); if (blurEffect != null) { blurEffect.enabled = false; } }
private void OnEnable() { m_camera = GetComponent <Camera>(); //m_camera.depthTextureMode = DepthTextureMode.Depth; m_camera.clearStencilAfterLightingPass = false; m_blurImageEffect = GetComponent <BlurOptimized>(); m_blurImageEffect.enabled = false; }
private void OnEnable() { m_camera = GetComponent<Camera>(); //m_camera.depthTextureMode = DepthTextureMode.Depth; m_camera.clearStencilAfterLightingPass = false; m_blurImageEffect = GetComponent<BlurOptimized>(); m_blurImageEffect.enabled = false; }
private void Awake() { this.ssaoMaterial = new Material(this.ssaoShader); this.blur = base.GetComponent <BlurOptimized>(); this.blur.enabled = false; this.uvRadiusDepth1 = this.CalculateUVRadiusDepth1(); this.samples = this.CalculateSamples(); this.rotationMap = this.CreateRotationMap(); }
void TurnOff() { blurScript = m_camera.GetComponentInChildren <BlurOptimized>(); //blurScript.enabled = false; //ColorScript = m_camera.GetComponentInChildren<ColorCorrectionCurves>(); //ColorScript.enabled = false; GameManager.PlayerModel.SetUnderWater(false); }
public override void BeforeSwitch(FageStateMachine stateMachine, string afterId) { base.BeforeSwitch(stateMachine, afterId); _effector = null; _screen = null; _blur = null; _presetFrom = null; _presetTo = null; }
private void Start() { _blur = Camera.main.EnsureComponent <BlurOptimized>(); _blurSizeTarget = _blur.blurSize; _blurIterationTarget = _blur.blurIterations; _blur.blurSize = 0; _blur.blurIterations = 0; _blur.enabled = false; }
protected override void Start() { base.Start(); _originalPos = transform.localPosition; _originalRotation = transform.rotation; _blurComp = GetComponent <BlurOptimized>(); _cameraShake = GetComponent <CameraShake>(); _cameraZoom = GetComponent <CameraZoom>(); }
void Start() { blurEffect = GetComponent <BlurOptimized>(); if (blurEffect != null) { blurEffect.enabled = false; } firstXDistance = transform.position.x - playerController.transform.position.x; firstZDistance = transform.position.z - playerController.transform.position.z; }
// Use this for initialization void Start() { Timer = GameObject.Find ("Timer"); timeText = Timer.GetComponent <Text> (); blurScript = GameObject.Find ("FirstPersonCharacter").GetComponent<BlurOptimized> (); hudPanel = GameObject.Find ("HUD"); managerScript = GameObject.Find ("New_Player").GetComponent<Game_Manager> (); levelBestText = GameObject.Find ("BestText").GetComponent<Text>(); levelBestText.text = levelBest.ToString(); }
void Awake() { thisT = transform; instance = this; //cam=Camera.main; camT = Camera.main.transform; blurEffect = camT.GetComponent <BlurOptimized>(); }
public void Awake() { cam = this.GetComponent <Camera>(); quad = this.transform.Find("Quad").gameObject; quadRenderer = quad.GetComponent <MeshRenderer>(); blurOptimized = this.GetComponent <BlurOptimized>(); mapMat.SetFloat("_DeltaX", seedPos.x); mapMat.SetFloat("_DeltaY", seedPos.y); previousSeedPos = seedPos; }
private void Awake() { CreateBuffers(); CreateMaterials(); m_blur = GetComponent <BlurOptimized>(); m_blur.enabled = false; m_RTWidth = (int)(Screen.width / (float)m_resolution); m_RTHeight = (int)(Screen.height / (float)m_resolution); }
//--------------------------------------------------------------------------------------------------- void Awake() { CreateRenderBuffer(); CreateMaterial(); this.m_blur = gameObject.AddComponent <BlurOptimized>(); this.m_blur.enabled = false; this.m_blur.blurSize = 1.5f; this.m_blur.blurIterations = 2; this.m_blur.downsample = 1; }
void Awake() { anim = GetComponent <Animator>(); blur = GetComponent <BlurOptimized>(); glitch = GetComponent <VideoGlitchSpectrumOffset>(); motionBlur = GetComponent <MotionBlur>(); noise = GetComponent <NoiseAndGrain>(); grayScale = GetComponent <Grayscale>(); maxHorizontalDistance = 1 - leftViewportLimit - (1 - rightViewportLimit); maxVerticalDistance = 1 - bottomViewportLimit - (1 - topViewportLimit); }
void Start() { sm = GameObject.Find("SoundManager").GetComponent <SoundManager>(); tf = transform; rb = GetComponent <Rigidbody>(); hasBonus = false; StartCoroutine(WaitForBonus()); timber = tf.FindChild("Timber").gameObject; isPaused = false; pause = GameObject.Find("Pause").GetComponent <Text>(); blur = Camera.main.GetComponent <BlurOptimized>(); }
//private GameObject mapBackground; // private Vector3 fullMapPosition = new Vector3(250 void Start() { cam = gameObject.GetComponent<Camera> (); fpsController = GameObject.FindGameObjectWithTag ("Player").GetComponent<FirstPersonController>(); controlsUI = GameObject.FindGameObjectWithTag ("Player").GetComponent<ControlsUIController>(); cameraBlur = GameObject.FindGameObjectWithTag ("Player").GetComponentInChildren<BlurOptimized>(); //mapBackground = GameObject.Find ("MapBackground"); defaultPosition = new Vector3 (target.position.x, transform.position.y, target.position.z); float width = 0.15f; float height = width * 2; miniRect = new Rect (1 - width, 1 - height, width, height); fullRect = new Rect (-0.1f, 0, 1, 1); //cam.rect = new Rect (Screen.width - width, Screen.height - height, width, height); displayMiniMap (); //cameraBlur.enabled = false; //mapBackground.SetActive (false); //cam.rect = new Rect (0,0, width, width); //Debug.Log (width); }
private void Awake() { CreateBuffers(); CreateMaterials(); SetOccluderObjects(); // m_blur = gameObject.AddComponent<BlurOptimized>(); m_blur = GetComponent<BlurOptimized>(); m_blur.enabled = false; GameObject[] occludees = GameObject.FindGameObjectsWithTag(HighlightManager.Instance.m_occludeesTag); // highlightObjects = new Renderer[occludees.Length]; foreach (GameObject occludee in occludees) { HighlightManager.Instance.highlightObjects.Add(occludee.GetComponent<Renderer>()); } // for( int i = 0; i < occludees.Length; i++ ) // highlightObjects[i] = occludees[i].GetComponent<Renderer>(); m_RTWidth = (int) (Screen.width / (float) HighlightManager.Instance.m_resolution); m_RTHeight = (int) (Screen.height / (float) HighlightManager.Instance.m_resolution); }
private void FinishChallenge() { timeOverSource.enabled = true; timeOverSource.Play (); canContinue = false; totalScore += driftScore; if(driftScore > maxDriftScore) { maxDriftScore = driftScore; dataManager.bestDrift = maxDriftScore; PlayerPrefs.SetInt ("bestDrift", maxDriftScore); } driftScore = 0; multiplier = 0; // Change game state ended = true; gameplayUI.SetActive (false); actualCamera = carEngine.GetComponent<CameraRig>().cameraTransform[carEngine.GetComponent<CameraRig>().activeCamera].GetComponent<BlurOptimized>(); actualCamera.enabled = true; pauseAnimation = true; endLabel.text = totalScore.ToString (); // Disable Player controller carController.enabled = false; carEngine.brake = 1; carEngine.throttle = 0; carEngine.steer = 0; Invoke ("EnableEndUI", 2.0f); }
private IEnumerator DecreaseAndRemoveBlur( BlurOptimized blur ) { while (blur.blurSize > 0.0f) { yield return new WaitForSeconds( 0.5f ); blur.blurSize = blur.blurSize - 1.0f; } blur.enabled = false; }
void Start() { renderTexture.Release(); firstPosition = this.transform.position; firstScale = transform.localScale; firstRotation = transform.localEulerAngles; toObjectSender = AToBObjectSender(ObjectSender, this.gameObject,t*0.05f); blurOptimizerd = mainCamera.GetComponent<BlurOptimized>(); _mat.SetFloat("_Alpha", 1); TargetPointChange(); }
void Start() { mainCanvas = GameObject.Find ("Canvas"); timeScaler = GameObject.Find ("Time Manager").GetComponent<TimeScaler>(); healthManager = GameObject.Find ("Health Manager").GetComponent<HealthManager> (); screenFader = GameObject.Find ("Screen Fade").GetComponent<ScreenFade> (); blurFX = GameObject.FindWithTag ("MainCamera").GetComponent<BlurOptimized> (); blurFX.enabled = false; pauseScreen.SetActive (false); failScreen.SetActive (false); invHUD = GameObject.Find ("HUD_Inventory").GetComponent<HUD_Inventory> (); healthHUD = GameObject.Find("HUD_Healthbar").GetComponent<HUD_Healthbar>(); timeButton = GameObject.Find("Time Button"); pauseButton = GameObject.Find ("PauseButton"); mapButton = GameObject.Find ("Map Button"); alertCountdown = GameObject.Find ("AlertCountdownIcon"); }
void Start() { audi = gameObject.GetComponent<AudioSource>(); GetAllTheCow(); blurEffect = mainCamera.GetComponent<BlurOptimized>(); cowCounterT.text = counter.ToString(); }
// Use this for initialization void Start() { #if UNITY_EDITOR if (TestNewGame) HarmonicSerialization.Instance.IsNewGame = true; #endif if (HarmonicSerialization.Instance.IsNewGame) { blurrer = Camera.main.GetComponent<BlurOptimized>(); blurrer.enabled = true; blurrer.blurSize = 5; topSlit.enabled = true; bottomSlit.enabled = true; ClockCanvas.enabled = false; Spotlight1.intensity = Spotlight2.intensity = 0; computerVoiceAudio = this.gameObject.AddComponent<AudioSource>(); computerVoiceAudio.clip = WakeyWakey; computerVoiceAudio.playOnAwake = false; filter = this.gameObject.AddComponent<AudioLowPassFilter>(); filter.cutoffFrequency = 800f; Radio.Instance.Primary.volume = .25f; StartCoroutine(MoveSlits()); } else { DestroySlits(); this.enabled = false; GameObject.Destroy(EmergencyLight); if (TestTutorial && GameObject.Find("Tutorial") == null) { HarmonicSerialization.Instance.CurrentSave = SaveGame.GetNewDefault("DEBUG"); StartTutorialScript(); } } }
private void Reset() { highlightShader = Shader.Find("Custom/Highlight"); m_blurImageEffect = gameObject.AddComponent<BlurOptimized>(); m_blurImageEffect.enabled = false; }
void Start() { blurActive = false; blur = GetComponent<BlurOptimized>(); blur.enabled = false; }
void Awake () { this.blur = this.GetComponentInChildren<BlurOptimized>(); this.blur.blurSize = 0; this.blur.blurIterations = 1; this.blur.enabled = false; }
void Awake () { cam = GetComponent<Camera> (); cam.depth = depth; blur = GetComponent<BlurOptimized> (); }
public void SetPause(bool isPaused) { pause = isPaused; if(isPaused) { // Save previous time scale for drift tutorial previousTimeScale = Time.timeScale; Time.timeScale = 1.0f; // Disable main scripts settings = false; carController.enabled = false; carEngine.enabled = false; bloomUI.enabled = true; for(int i = 0; i < carSetup.Wheels.Length; i++) { carSetup.Wheels[i].enabled = false; } rigidbodyVelocity = carEngine.GetComponent<Rigidbody>().velocity; carEngine.GetComponent<Rigidbody>().isKinematic = true; pauseUI.SetActive (true); gameplayUI.SetActive (false); settingsUI.SetActive(false); backgroundTween.SetTween(1); EventSystem.current.SetSelectedGameObject(pauseUI.transform.GetChild(0).gameObject); if(dataManager.isGamepad) { #if !UNITY_EDITOR UnityEngine.Cursor.visible = false; UnityEngine.Cursor.lockState = CursorLockMode.Locked; #endif } else { #if !UNITY_EDITOR UnityEngine.Cursor.visible = false; UnityEngine.Cursor.lockState = CursorLockMode.None; #endif } // Enable camera effects if(carEngine.GetComponent<CameraRig>().activeCamera == 0) { Camera.main.GetComponent<CarCamera>().enabled = false; } // Play pause sound audioSource.clip = pauseClip; if(!audioSource.isPlaying) { audioSource.Play (); } // Disable car audio carAudio.DisableSources(); actualCamera = carEngine.GetComponent<CameraRig>().cameraTransform[carEngine.GetComponent<CameraRig>().activeCamera].GetComponent<BlurOptimized>(); actualCamera.enabled = true; pauseAnimation = true; } else { // Restore previous time scale Time.timeScale = previousTimeScale; // Disable main scripts settings = false; bloomUI.enabled = false; for(int i = 0; i < carSetup.Wheels.Length; i++) { carSetup.Wheels[i].enabled = true; } carController.enabled = true; carEngine.enabled = true; carEngine.GetComponent<Rigidbody>().isKinematic = false; carEngine.GetComponent<Rigidbody>().velocity = rigidbodyVelocity; pauseUI.SetActive (false); gameplayUI.SetActive (true); settingsUI.SetActive(false); backgroundTween.SetTween(2); EventSystem.current.SetSelectedGameObject(null); if(dataManager.isGamepad) { #if !UNITY_EDITOR UnityEngine.Cursor.visible = false; UnityEngine.Cursor.lockState = CursorLockMode.Locked; #endif } else { #if !UNITY_EDITOR UnityEngine.Cursor.visible = false; UnityEngine.Cursor.lockState = CursorLockMode.None; #endif } // Enable camera effects if(carEngine.GetComponent<CameraRig>().activeCamera == 0) { Camera.main.GetComponent<CarCamera>().enabled = true; } // Play pause sound audioSource.clip = selectClip; if(!audioSource.isPlaying) { audioSource.Play (); } actualCamera = carEngine.GetComponent<CameraRig>().cameraTransform[carEngine.GetComponent<CameraRig>().activeCamera].GetComponent<BlurOptimized>(); actualCamera.enabled = true; pauseAnimation = true; } }
private void ResetFadeIn() { // Reset values ended = false; leftTime = leftTimeInit; totalScore = 0; carSetup.NitroLeft = carSetup.NitroInitialAmount; carRigidbody.isKinematic = true; carEngine.enabled = false; carController.enabled = false; carRigidbody.transform.position = new Vector3(0, 0.0f, 5.0f * carRigidbody.GetComponent<NetworkIdentity>().playerControllerId); carEngine.enabled = true; carController.enabled = true; carRigidbody.isKinematic = false; // Update UI UnfreezePlayer(); backgroundTween.SetTween(2); actualCamera = carEngine.GetComponent<CameraRig>().cameraTransform[carEngine.GetComponent<CameraRig>().activeCamera].GetComponent<BlurOptimized>(); actualCamera.enabled = false; endUI.SetActive(false); gameplayUI.SetActive(true); // Fade in fade.gameObject.SetActive(true); fade.SetTween(2); }
//Initialize all components void Awake(){ cameraBlur = Camera.main.GetComponent<BlurOptimized>(); audioSource = this.GetComponent<AudioSource>(); }