// Use this for initialization void Start() { // アタッチされてないなら代入する if (Vignette == null) { Vignette = GetComponent <VignetteAndChromaticAberration>(); } if (MotionsBlur == null) { MotionsBlur = GetComponent <MotionBlur>(); } // けーコンフィグの宣言 hKeyConfigSettings hk = new hKeyConfigSettings(); hk.Init(); // 視差効果がオンになっているか //print(hKeyConfigSettings.ParallaxEffect); if (false == hKeyConfigSettings.ParallaxEffect) { GetComponent <VignetteAndChromaticAberration>().enabled = false; GetComponent <MotionBlur>().enabled = false; } if (Player == null) { Player = GameObject.Find("Player"); } }
// Use this for initialization void Start() { effect = GetComponentInChildren <VignetteAndChromaticAberration>(); effect2 = GetComponentInChildren <Tonemapping>(); minValue = effect.intensity; baseExposure = effect2.exposureAdjustment; }
void OnEnable() { mainCam = Camera.main; if (mainCam != null) { if (enableChromaticAberration && chromAb == null) { chromAb = mainCam.gameObject.GetComponent <VignetteAndChromaticAberration>(); if (chromAb == null) { this.enabled = false; Debug.LogWarning("ImageEffectsOnLowHP: No 'Vignette and Chromatic Aberration' component could be found! Disabling script..."); } } if (enableColorCorrection && colorCorr == null) { colorCorr = mainCam.gameObject.GetComponent <ColorCorrectionCurves>(); if (colorCorr == null) { this.enabled = false; Debug.LogWarning("ImageEffectsOnLowHP: No 'Color Correction Curves' component could be found! Disabling script..."); } } if (chromAb != null) { chromAb.enabled = false; } if (colorCorr != null) { colorCorr.enabled = false; } } }
private IEnumerator ContainAnimation(bool b) { this.NetworkportalPosition = Vector3.zero; VignetteAndChromaticAberration vaca = base.GetComponentInChildren <VignetteAndChromaticAberration>(); this.fpc.m_JumpSpeed = 0f; this.goingViaThePortal = true; yield return(new WaitForSeconds(15f)); float y = base.transform.position.y - 2.5f; this.fpc.noclip = true; while (base.transform.position.y > y && this.ccm.curClass != 2) { if (base.transform.position.y - 2f < y) { vaca.intensity += Time.deltaTime / 2f; } vaca.intensity = Mathf.Clamp(vaca.intensity, 0.036f, 1f); base.transform.position += Vector3.down * Time.deltaTime / 2f; yield return(new WaitForEndOfFrame()); } this.fpc.noclip = false; if (b) { this.Kill(); } this.goingViaThePortal = false; yield break; }
IEnumerator SwitchLevelAnimation() { isSwitching = true; Image white = transform.Find("white").GetComponent <Image>(); white.enabled = true; white.CrossFadeAlpha(0, 0, true); white.CrossFadeAlpha(1, 1, true); Transform controls = transform.Find("Controls"); CanvasGroup controlscg = controls.GetComponent <CanvasGroup>(); AsyncOperation async = SceneManager.LoadSceneAsync(1); async.allowSceneActivation = false; Camera cam = Camera.allCameras[0]; VignetteAndChromaticAberration vig = cam.GetComponent <VignetteAndChromaticAberration>(); float startTime = Time.time; while (Time.time - 3f - Time.deltaTime < startTime) { controlscg.alpha = Mathf.Lerp(1, 0, curve.Evaluate((Time.time - startTime))); vig.intensity = Mathf.Lerp(0, 0.25f, curve.Evaluate(1 - (Time.time - startTime) / 2.5f)); cam.transform.eulerAngles = Vector3.Lerp(new Vector3(10, 20, 0), new Vector3(0, 0, 0), curve.Evaluate(1 - (Time.time - startTime) / 2.5f)); cam.transform.position = Vector3.Lerp(new Vector3(0, -12, -2), new Vector3(0, -10, 0), curve.Evaluate(1 - (Time.time - startTime) / 2.5f)); RenderSettings.ambientLight = Color.Lerp(RenderSettings.ambientLight, Color.white, Time.deltaTime * 5); yield return(new WaitForEndOfFrame()); } async.allowSceneActivation = true; }
void Awake() { _camObject = Camera.main.gameObject; _chromAb = _camObject.GetComponent <VignetteAndChromaticAberration>(); _noiseAndGrain = _camObject.GetComponent <NoiseAndGrain>(); audio = GetComponent <AudioSource>(); }
void Start() { tonemapping = GetComponent <Tonemapping>(); vignette = GetComponent <VignetteAndChromaticAberration>(); noiseAndGrain = GetComponent <NoiseAndGrain>(); inStealth = true; }
// Use this for initialization void Start() { _health = StartingHealth; EventManager.AddListener((int) GameManagerScript.GameEvents.DamagePlayer, OnHit); CameraEffects = Camera.main.GetComponent<VignetteAndChromaticAberration>(); EventManager.AddListener((int) GameManagerScript.GameEvents.LoadlastCheckpoint, OnLoadLastCheckpoint); }
void Start() { cam = GetComponent <Camera>(); effects = GetComponent <VignetteAndChromaticAberration>(); ppAnimator = GetComponent <PostProcessingAnimator>(); title = GameObject.FindWithTag("Title").gameObject.GetComponent <SpriteRenderer>(); if (target == null) { //Debug.LogWarning("Camera has no target, gonna try to find an object tagged 'Player'"); target = GameObject.FindWithTag("Player").GetComponent <PlayerMovement>(); transform.position = new Vector3(target.transform.position.x, target.transform.position.y, transform.position.z); if (target == null) { Debug.LogError("No object tagged 'Player'"); } } if (GameObject.FindGameObjectWithTag("SaveSystem").GetComponent <SaveSystem>().PillarsDestroyed.Count > 0) { title.enabled = false; ppAnimator.FadeIn(); target.enabled = true; } else { target.enabled = false; StartCoroutine(TitleScreen()); } }
IEnumerator Start() { Camera cam = Camera.allCameras[0]; VignetteAndChromaticAberration vig = cam.GetComponent <VignetteAndChromaticAberration>(); vig.intensity = 0; yield return(new WaitForSeconds(1)); CaptationDisplay.instance.DisplayText(5, "Welcome testsub... <b>*cough*</b> Contestant 55"); float startTime = Time.time; while (Time.time < startTime + 1) { vig.intensity = Mathf.Lerp(0, 0.25f, Time.time - startTime); yield return(new WaitForEndOfFrame()); } yield return(new WaitForSeconds(5)); CaptationDisplay.instance.DisplayText(5, "This is you.. ofcourse you already know who you are... but anyways"); Transform target1 = GameObject.Find("PlayerObject").transform; startTime = Time.time; while (Time.time < startTime + 6) { target1.position = Vector3.Lerp(target1.position, new Vector3(0.5f, 0, 1.89f), Time.deltaTime * 5); yield return(new WaitForEndOfFrame()); } //yield return new WaitForSeconds(7); already waited 7 seconds CaptationDisplay.instance.DisplayText(5, "Your objective will be to complete the upcoming tests!"); Transform target2 = GameObject.Find("StorageCube").transform; Transform target3 = GameObject.Find("Turret").transform; startTime = Time.time; while (Time.time < startTime + 6) { target1.position = Vector3.Lerp(target1.position, new Vector3(0.5f, 3, 1.89f), Time.deltaTime); target2.position = Vector3.Lerp(target2.position, new Vector3(0.5f, 0, 1.89f), Time.deltaTime * 5); target3.position = Vector3.Lerp(target3.position, new Vector3(-0.5f, -0.3f, 1.89f), Time.deltaTime * 5); yield return(new WaitForEndOfFrame()); } CaptationDisplay.instance.DisplayText(3, "Only then will you be able to 'win' the 60 bucks, good luck!"); startTime = Time.time; while (Time.time < startTime + 5) { target2.position = Vector3.Lerp(target2.position, new Vector3(0.5f, 3, 1.89f), Time.deltaTime); target3.position = Vector3.Lerp(target3.position, new Vector3(-0.5f, 3, 1.89f), Time.deltaTime); vig.intensity = Mathf.Lerp(0.25f, 0, Time.time - startTime); yield return(new WaitForEndOfFrame()); } AsyncOperation async = SceneManager.LoadSceneAsync((SceneManager.GetActiveScene().buildIndex + 1) % SceneManager.sceneCountInBuildSettings); }
void Start() { initFov = Camera.main.fieldOfView; minFov = initFov / zoom; v = GetComponent <VignetteAndChromaticAberration>() as VignetteAndChromaticAberration; b = GetComponent <BloomOptimized>(); player = FindObjectOfType <HealthManager>(); }
// Use this for initialization void Start() { VignetteAndChromaticAberration VaCA = GetComponent <VignetteAndChromaticAberration>(); VaCA.intensity = .25f; VaCA.blur = 2.5f; VaCA.chromaticAberration = 4f; }
// Use this for initialization void Start() { rigid = GetComponent <Rigidbody2D>(); anim = GetComponentInChildren <Animator>(); sprite = GetComponentInChildren <SpriteRenderer>(); vACA = Camera.main.GetComponent <VignetteAndChromaticAberration>(); vACATimer = 0; }
void Start() { bo = GetComponent <BloomOptimized>(); bo.enabled = false; vaca = GetComponent <VignetteAndChromaticAberration>(); vaca.enabled = false; so = GetComponent <ScreenOverlay>(); so.enabled = false; }
void Start() { bo = GetComponent<BloomOptimized>(); bo.enabled = false; vaca = GetComponent<VignetteAndChromaticAberration>(); vaca.enabled = false; so = GetComponent<ScreenOverlay>(); so.enabled = false; }
void Start () { if (camera != null) { blurEffect = camera.gameObject.GetComponent<Blur> (); noiseEffect = camera.gameObject.GetComponent<NoiseAndGrain> (); vignetteEffect = camera.gameObject.GetComponent<VignetteAndChromaticAberration> (); } DisableVisualEffect (); }
private void Start() { normalFOV = FPSCamera.fieldOfView; aimingFOV = FPSCamera.fieldOfView - FOVchange; vignette = FPSCamera.GetComponent <VignetteAndChromaticAberration>(); pauseManager = GameObject.FindGameObjectWithTag("PauseManager").GetComponent <PauseManager>(); audSource = GetComponent <AudioSource>(); player = GameObject.FindGameObjectWithTag("Player").GetComponent <Player>(); }
// Use this for initialization void Awake() { cameraDelta = Vector3.zero; controller = GetComponent <SteamVR_TrackedObject>(); if (cameraRig != null) { fovLimiter = cameraRig.GetComponentInChildren <VignetteAndChromaticAberration>(); } }
void Awake() { vignetteFilter = gameObject.GetComponent <VignetteAndChromaticAberration>(); noiseFilter = gameObject.GetComponent <NoiseAndScratches>(); blurFilter = gameObject.GetComponent <CameraMotionBlur>(); bloomFilter = gameObject.GetComponent <Bloom>(); maxVignetteIntensity = lightVignetteIntensity; vignetteSpeed = lightVignetteSpeed; }
protected override void Start() { base.Start(); imageEffect = ImageEffectsManager.current.vignetteAndChromaticAberration; mainCharacter = unit as MainCharacter; vignetting = imageEffect.intensity; blurredCorners = imageEffect.blur; chromaticAberration = imageEffect.chromaticAberration; }
// Use this for initialization void Start () { food.value = water.value = health.value = 20; food.tick = water.tick = health.tick = 1; chromatic_Vignette = Camera.main.GetComponent<VignetteAndChromaticAberration>(); chromatic_Vignette.enabled = false; timer = 0; consume = 3; ritualButtonAnimation.Play("buttonRitualIddle"); }
public void Overwrite(VignetteAndChromaticAberration target) { target.intensity = intensity; target.chromaticAberration = chromaticAberration; target.axialAberration = axialAberration; target.blur = blur; target.blurSpread = blurSpread; target.luminanceDependency = luminanceDependency; target.blurDistance = blurDistance; }
void Start() { if (mainCamera == null) { mainCamera = Camera.main; } chromTarget = 0; chromSmoothTime = .2f; vignetteController = mainCamera.GetComponent <VignetteAndChromaticAberration>(); }
void Start() { if (sliderText == null) { Debug.LogError("Slider Text missing in script !"); } vignette = GameObject.Find("Main Camera").GetComponent <VignetteAndChromaticAberration>(); vignettingStart = vignette.intensity; }
private void Copy(VignetteAndChromaticAberration toCopy) { intensity = toCopy.intensity; chromaticAberration = toCopy.chromaticAberration; axialAberration = toCopy.axialAberration; blur = toCopy.blur; blurSpread = toCopy.blurSpread; luminanceDependency = toCopy.luminanceDependency; blurDistance = toCopy.blurDistance; }
void Start() { chroma = GetComponent <VignetteAndChromaticAberration> (); bloom = GetComponent <Bloom> (); if (target) { body = target.GetComponent <Rigidbody2D> (); } }
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"); }
void Awake() { triggeredCheck = false; vignette = GameObject.Find("Camera").GetComponent<VignetteAndChromaticAberration>(); startVignetteIntensity = vignette.intensity; musicResumed = false; crouched = false; playersTrans = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren<Camera>().transform; totalDuration = encounterDuration; }
void Awake() { Camera.main.transform.position = CamStartPos.position; Camera.main.transform.rotation = CamStartPos.rotation; playerGamemanager = GetComponent <PlayerGamemanger>(); vignette = Camera.main.GetComponent <VignetteAndChromaticAberration>(); vignette.intensity = VIGNETTE_START_VAL; }
void Start() { vignette = Camera.main.GetComponent <VignetteAndChromaticAberration>(); originalVignette = vignette.intensity; originalBlur = vignette.blur; originalDistance = vignette.blurDistance; brightness = Camera.main.GetComponent <Brightness>(); //DoPause(); UnPause(); }
/* * Initialisation. */ void Start() { if (DeviceManager._instance) { //Setup SteamVR Objects: headObject = DeviceManager._instance.GetHeadsetTransform().gameObject; leftControllerObject = DeviceManager._instance.GetControllerLeftHandObject(); rightControllerObject = DeviceManager._instance.GetControllerRightHandObject(); leftControllerTrackedObject = leftControllerObject.GetComponent <SteamVR_TrackedObject>(); rightControllerTrackedObject = rightControllerObject.GetComponent <SteamVR_TrackedObject>(); leftController = DeviceManager._instance.GetControllerLeftHand(); rightController = DeviceManager._instance.GetControllerRightHand(); leftControllerIndex = (int)leftControllerTrackedObject.index; rightControllerIndex = (int)rightControllerTrackedObject.index; //Convert button enum to button ID: switch (runButton) { case ControllerButton.Grip: runButtonId = EVRButtonId.k_EButton_Grip; break; case ControllerButton.TouchPad: runButtonId = EVRButtonId.k_EButton_SteamVR_Touchpad; break; case ControllerButton.Trigger: runButtonId = EVRButtonId.k_EButton_SteamVR_Trigger; break; default: runButtonId = EVRButtonId.k_EButton_Grip; break; } //Store animation curve incase it gets disabled in the inspector: storedSwingCurve = controllerSwingToMovementCurve; //Pre-seed controller positions: leftControllerLocalPosition = leftControllerObject.transform.localPosition; rightControllerLocalPosition = rightControllerObject.transform.localPosition; leftControllerPreviousLocalPosition = leftControllerLocalPosition; rightControllerPreviousLocalPosition = rightControllerLocalPosition; //Get image effect for fov limiting: if (fovLimiter == null) { fovLimiter = DeviceManager._instance.GetHeadsetTransform().gameObject.GetComponentInChildren <VignetteAndChromaticAberration>(); } } else { Debug.LogError("FATAL: DeviceManager instance is not initialised!"); } }
/* ---------------------------------------- * At Start, set 'initFov' as the Camera's FOV level, calculate 'minFov'. * Also, store the Vignette And Chromatic Aberration image effect attached to the camera in a variable */ void Start() { // set 'initFov' as the Camera's FOV level initFov = Camera.main.fieldOfView; // calculate the minimum FOV allowed by dividing the initial FOV by the maximum Zooming alllowed minFov = initFov / zoom; // create shorthand for the Vignette And Chromatic Aberration image effect attached to the camera v = this.GetComponent <VignetteAndChromaticAberration>() as VignetteAndChromaticAberration; }
void Start() { // anim = GetComponent<Animator>(); rb = GetComponent <Rigidbody>(); OldAngle = 0; SprintMeterTimer = 1f; cam = Camera.main; fov = cam.fieldOfView; vaca = cam.GetComponent <VignetteAndChromaticAberration>(); }
/* ---------------------------------------- * At Start, set 'initFov' as the Camera's FOV level, calculate 'minFov'. * Also, store the Vignette And Chromatic Aberration image effect attached to the camera in a variable */ void Start() { // set 'initFov' as the Camera's FOV level initFov = Camera.main.fieldOfView; // calculate the minimum FOV allowed by dividing the initial FOV by the maximum Zooming alllowed minFov = initFov / zoom; // create shorthand for the Vignette And Chromatic Aberration image effect attached to the camera v = this.GetComponent<VignetteAndChromaticAberration>() as VignetteAndChromaticAberration; }
// Use this for initialization void Start() { _SSAO = GetComponent <ScreenSpaceAmbientOcclusion> (); PlayerPrefs.SetInt("SSAO", 0); _CE = GetComponent <ContrastEnhance> (); PlayerPrefs.SetInt("CE", 0); _Bloom = GetComponent <BloomOptimized> (); PlayerPrefs.SetInt("Bloom", 0); _Vignette = GetComponent <VignetteAndChromaticAberration> (); PlayerPrefs.SetInt("Vignette", 0); }
// Use this for initialization void Start() { //oldPos = transform.position; fovLimiter = GetComponent <VignetteAndChromaticAberration>(); if (fovLimiter == null) { fovLimiter = gameObject.AddComponent <VignetteAndChromaticAberration>(); //create if we dont have it } //MaxSpeed = GameManager.sSpeedMultiplier * GameManager.kartMovementInfo.maxAcceleration; }
// Use this for initialization void Start() { SoundLevelSlider = GameObject.Find("SoundLevelSlider").GetComponent<Slider>(); MANAGER = GameObject.Find("_Manager").GetComponent<ManagerScript>(); MainCamera = GameObject.Find("MainCamera"); GrannyCam = GameObject.Find("GRANNYCAM"); Noise = MainCamera.GetComponent<NoiseAndScratches>(); Trippy = MainCamera.GetComponent<VignetteAndChromaticAberration>(); granny = GameObject.Find("GRANNY"); door = GameObject.Find("GRANNYDOOR"); player = GameObject.Find("PLAYER"); GrannySpot = GameObject.Find("GRANNYSPOT"); }
void Awake () { menuPlayer = GameObject.Find("MenuPlayer"); highscoreText = GameObject.Find("HighscoreText").GetComponent<Text>(); StartButton = GameObject.Find("StartGameButton"); highscoreText.text = "Highscore: " + PlayerPrefs.GetInt("score").ToString(); cameras = Camera.allCameras; foreach (Camera c in cameras) { if (c.name.Equals("Platform Camera Normal")) { chromaticAbberationCamera = c.GetComponent<VignetteAndChromaticAberration>(); } } }
void Start() { instance = this; trigger = false; BlackImg = gameObject.GetComponent<Image>(); vignette = Camera.main.GetComponent<VignetteAndChromaticAberration>(); if (vignette != null) { fade_PlayerDead_Info.Vgnetting_min = vignette.intensity; fade_PlayerDead_Info.chromaticAberration_min = vignette.chromaticAberration; } }
void Start() { camera = GetComponent<Camera>(); darkness = GetComponent<VignetteAndChromaticAberration>(); fisheye = GetComponent<Fisheye>(); playerCol = player.GetComponent<BoxCollider>(); playerRig = player.GetComponent<Rigidbody>(); initialPosition = camera.transform.position; // Position of camera normally playerRigid = player.GetComponent<Rigidbody>(); playerCollider = player.GetComponent<BoxCollider>(); // Setting of camera camera.fieldOfView = glitchZoom; camera.transform.position = new Vector3(cameraInitPoint.position.x, cameraInitPoint.position.y, camera.transform.position.z); // Adjusting screen float targetaspect = 16.0f / 9.0f; float windowaspect = (float)Screen.width / (float)Screen.height; float scaleheight = windowaspect / targetaspect; Rect rect = camera.rect; if (scaleheight < 1.0f) { rect.width = 1.0f; rect.height = scaleheight; rect.x = 0.0f; rect.y = (1.0f - scaleheight)/2.0f; camera.rect = rect; // Adjusting UI height = Screen.currentResolution.height; pix = camera.pixelHeight; newYPosition = ((pix - height) / 2.0f); topLeft.anchoredPosition = new Vector2(topLeft.anchoredPosition.x, newYPosition); bossLives.anchoredPosition = new Vector2(bossLives.anchoredPosition.x, newYPosition); } }
void Start() { motionBlur = Camera.main.GetComponent<MotionBlur>(); twirl = Camera.main.GetComponent<Twirl>(); fisheye = Camera.main.GetComponent<Fisheye>(); vignette = Camera.main.GetComponent<VignetteAndChromaticAberration>(); noise = Camera.main.GetComponent<NoiseAndGrain>(); motionBlur.enabled = false; twirl.enabled = false; fisheye.enabled = false; vignette.enabled = false; noise.enabled = false; }
void Start() { // anim = GetComponent<Animator>(); rb = GetComponent<Rigidbody>(); OldAngle = 0; SprintMeterTimer = 1f; cam = Camera.main; fov = cam.fieldOfView; vaca = cam.GetComponent<VignetteAndChromaticAberration>(); }
void Start() { vignette = Camera.main.GetComponent<VignetteAndChromaticAberration>(); originalVignette = vignette.intensity; originalBlur = vignette.blur; originalDistance = vignette.blurDistance; brightness = Camera.main.GetComponent<Brightness>(); DoPause(); }
protected override void Awake() { base.Awake(); _vignetting = GetComponent<VignetteAndChromaticAberration>(); }
// Use this for initialization void Start () { tw = GetComponent<Twirl>(); g = GetComponent<Grayscale>(); v = GetComponent<VignetteAndChromaticAberration>(); Search(); }
void Start( ) { //Assign camera effect vars CameraVignette = GetComponent<VignetteAndChromaticAberration>( ); CameraBloom = GetComponent<BloomOptimized>( ); CameraDoF = GetComponent<DepthOfField>( ); CameraPos = new Vector3( ); //Debug SetCameraMode( CameraMode.GAME ); }
void Start() { currentSlide = slide.nullstate; theCanvas = GameObject.Find ("Canvas"); cmaera = GameObject.Find ("Main Camera"); cmaeraTr = cmaera.transform; umbrella = GameObject.Find ("Umbrella_Presentation"); umbrellaTr = umbrella.transform; umbrellaAnim = umbrella.GetComponent<Animator> (); npcTR = GameObject.Find ("NPC").transform; npcAnim = GameObject.Find ("NPC").GetComponent<Animator> (); npcHands = GameObject.Find ("Hands").GetComponent<Animator> (); kittenAnim = GameObject.Find ("kitten 1").GetComponent<Animator> (); kittentr = GameObject.Find ("kitten 1").transform; blurring = cmaera.GetComponent<VignetteAndChromaticAberration> (); }
public void Initialize() { Party = new PlayerParty(this); Party.Initialize(); TimedAction = new PlayerTimedAction(this); _vignette = Camera.main.GetComponent<VignetteAndChromaticAberration>(); IsHoldToAim = true; _numberOfRocks = 10; InputEventHandler.OnCameraSwitchMode += SwitchCameraMode; InputEventHandler.OnPlayerMove += this.OnPlayerMove; InputEventHandler.OnPlayerStopMove += this.OnPlayerStopMove; InputEventHandler.OnWeaponPullTrigger += this.OnWeaponPullTrigger; InputEventHandler.OnWeaponReleaseTrigger += this.OnWeaponReleaseTrigger; InputEventHandler.OnRMBDown += this.OnRMBDown; InputEventHandler.OnRMBUp += this.OnRMBUp; InputEventHandler.OnLRMBDown += this.OnLRMBDown; InputEventHandler.OnKick += this.OnKick; InputEventHandler.OnPlayerMoveLeft += this.OnPlayerMoveLeft; InputEventHandler.OnPlayerMoveRight += this.OnPlayerMoveRight; InputEventHandler.OnPlayerMoveUp += this.OnPlayerMoveUp; InputEventHandler.OnPlayerMoveDown += this.OnPlayerMoveDown; InputEventHandler.OnPlayerStopMoveLeft += this.OnPlayerStopMoveLeft; InputEventHandler.OnPlayerStopMoveRight += this.OnPlayerStopMoveRight; InputEventHandler.OnPlayerStopMoveUp += this.OnPlayerStopMoveUp; InputEventHandler.OnPlayerStopMoveDown += this.OnPlayerStopMoveDown; InputEventHandler.OnPlayerStartSprint += this.OnPlayerStartSprint; InputEventHandler.OnPlayerStopSprint += this.OnPlayerStopSprint; InputEventHandler.OnPlayerToggleSneak += OnToggleSneaking; InputEventHandler.OnPlayerThrow += OnThrow; InputEventHandler.OnPlayerSwitchWeapon2 += OnToggleWeapon2; InputEventHandler.OnPlayerSwitchWeapon1 += OnToggleWeapon1; InputEventHandler.OnPlayerSwitchThrown += OnToggleThrown; InputEventHandler.OnPlayerSwitchTool += OnToggleTool; InputEventHandler.OnPlayerReload += OnWeaponReload; InputEventHandler.OnToggleFlashlight += OnToggleFlashlight; InputEventHandler.OnGameTogglePause += ToggleGamePause; InputEventHandler.OnSelectMember1 += OnSelectMember1; InputEventHandler.OnSelectMember2 += OnSelectMember2; InputEventHandler.OnSelectMember3 += OnSelectMember3; InputEventHandler.OnSelectMember4 += OnSelectMember4; InputEventHandler.OnMouseSelect += OnPlayerMouseSelect; InputEventHandler.OnClearTask += OnClearTask; _moveDirection = PlayerMoveDirEnum.Stop; _moveDirection2 = PlayerMoveDirEnum.Stop; SelectedPC.CurrentStance = HumanStances.Run; _playerLight = GameObject.Find("PlayerLight").GetComponent<Light>(); _playerLight.intensity = 0.1f; }
// Use this for initialization void Start() { foreach (GameObject go in UnityEngine.Object.FindObjectsOfType<GameObject>()) { if ((go.layer == LayerMask.NameToLayer("Hidden KeyObjects") || go.layer == LayerMask.NameToLayer("Hidden Geometry"))) { MeshRenderer meshrenderer = go.GetComponent<MeshRenderer>(); if (meshrenderer != null) meshrenderer.enabled = false; } foreach (Transform t in go.transform) { if ((t.gameObject.layer != LayerMask.NameToLayer("Hidden KeyObjects") && t.gameObject.layer != LayerMask.NameToLayer("Hidden Geometry"))) continue; List<MeshRenderer> renderers = new List<MeshRenderer>(); renderers.AddRange(t.GetComponentsInChildren<MeshRenderer>()); foreach (MeshRenderer m in renderers) { m.enabled = false; } } } vignet = GetComponent<VignetteAndChromaticAberration>(); grayscale = GetComponent<Grayscale>(); playerController = GameObject.FindWithTag("Player").GetComponent<TwinStickController>(); if (!Application.isEditor) { Cursor.lockState = CursorLockMode.Confined; Cursor.visible = false; } }