// Use this for initialization void OnEnable() { //m_currentTimer gameFader = FindObjectOfType <GameFader>(); gameFader.FadeGame(fadeTimer, false); m_lerpTime = 1; targetRot = Quaternion.LookRotation(relativeRotation); originalRot = transform.rotation; player = FindObjectOfType <Player>(); }
// Use this for initialization void Start() { skullIcon_01.enabled = true; skullIcon_02.enabled = false; skullIcon_03.enabled = false; // This uses character controller since you don't want physics to affect the character with its camera // which can cause nausea. From experience, rigidbody remembers the forces applied to it even when kinematic // therefore when turned off, it gets applied to the system. m_controller = GetComponent <CharacterController>(); m_camera = GetComponentInChildren <Camera>(); m_eventManager = FindObjectOfType <EventManager>(); m_playerCollider = GetComponent <CapsuleCollider>(); m_originalHeight = m_controller.height; m_originalCentre = m_controller.center; m_cameraStandPosition = m_camera.transform.localPosition; m_lebenScript = FindObjectOfType <DrLeben>(); if (!m_hand) { if (GetComponentInChildren <HandAnimations>()) { m_hand = GetComponentInChildren <HandAnimations>().gameObject; } } // Set the colour of the vignette to be green for scarab attacks currentColour = new Color(0, 120f / 255f, 0, 0); //bottomVignette.color = currentColour; //topVignette.color = currentColour; //leftVignette.color = currentColour; //rightVignette.color = currentColour; boxVignette.color = currentColour; splatImage.color = currentColour; gameFader = FindObjectOfType <GameFader>(); cutscene = FindObjectOfType <CutsceneCamera>(); // mouse look initialisation m_charRot = transform.localRotation; m_cameraRot = m_camera.transform.localRotation; // Run speed ratio depending on toxicity m_toxicityToRunRatio = (m_runSpeed - m_walkSpeed) / m_maxToxicity; //press_E_Text.enabled = false; //playerInstruction.enabled = false; playerInstruction.text = ""; //requires_core_Text.enabled = false; coreCount = 0; SetCoreText(); //activate_Airlock_Text.enabled = false; if (m_handWalkPosition == Vector3.zero) { m_handWalkPosition = m_hand.transform.localPosition; } if (m_handRunPosition == Vector3.zero) { m_handRunPosition = m_handWalkPosition - new Vector3(0, 0.11f, 0); } //playerBaton.SetActive(false); //Set Slider starting toxicity to zero //toxicitySlider.value = m_currentToxicity; }
private void Start() { m_handAnimator = GetComponent <Animator>(); m_player = FindObjectOfType <Player>(); m_fader = FindObjectOfType <GameFader>(); }
// Use this for initialization void Start() { m_fader = FindObjectOfType <GameFader>(); }