void Awake() { _controllerScript = _controller.GetComponent <FirstPersonAIO>(); Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; _audioManager = FindObjectOfType <AudioManager>(); }
private void SaveObjectColor() { // create a dictionary and save unique instance id and color Object[] _allGameObjects = FindObjectsOfType <GameObject>(); Stopwatch _calc = new Stopwatch(); _calc.Start(); foreach (GameObject obj in _allGameObjects) { FirstPersonAIO _hasControllerScript = obj?.GetComponent <FirstPersonAIO>(); MeshRenderer _hasMeshRenderer = obj?.GetComponent <MeshRenderer>(); Ignore _hasIgnoreComponent = obj?.GetComponent <Ignore>(); if (_hasControllerScript == null) { if (_hasMeshRenderer != null && _hasIgnoreComponent == null) { Renderer _checkColor = obj?.GetComponent <Renderer>(); _storedObjects.Add(obj); _redColorValues.Add(obj.GetInstanceID(), _checkColor.material.color.r); _greenColorValues.Add(obj.GetInstanceID(), _checkColor.material.color.g); _blueColorValues.Add(obj.GetInstanceID(), _checkColor.material.color.b); } } } _calc.Stop(); string elapsedTime = string.Format("{0:00}:{1:00}:{2:00}.{3:00}", _calc.Elapsed.Hours, _calc.Elapsed.Minutes, _calc.Elapsed.Seconds, _calc.Elapsed.Milliseconds / 10); UnityEngine.Debug.Log(elapsedTime); }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { if (_hasOnlyAudio) { _audioSource.Play(); StartCoroutine(RemoveScript(_audioSource.clip.length)); } else if (_hasCutScene) { _director.Play(); StartCoroutine(RemoveScript((float)_director.duration)); } else if (_death) { _uiManager.Dead(); } if (_freezPlayer) { _player = other.GetComponent <FirstPersonAIO>(); _player.playerCanMove = false; } } }
// Start is called before the first frame update void Start() { player = GameObject.FindGameObjectWithTag("Player"); arms = GameObject.FindGameObjectWithTag("Arms"); script = player.GetComponent <FirstPersonAIO>(); script2 = player.GetComponent <PlayerInfo>(); }
void OnTriggerEnter(Collider weapon) { if (weapon.gameObject.CompareTag("Machete")) { Debug.Log("Player is dead"); isDead = true; DeathTrigger = true; CapsuleCollider collider = gameObject.GetComponent <CapsuleCollider>(); collider.direction = 2; FirstPersonAIO player = gameObject.GetComponent <FirstPersonAIO>(); player.enabled = false; rainDrops.SetActive(false); bloodDrops.SetActive(true); knifeObj.SetActive(false); } else if (weapon.gameObject.CompareTag("AK_Bullet")) { Debug.Log("Player is dead"); isDead = true; DeathTrigger = true; } else if (weapon.gameObject.CompareTag("Shell_Round")) { Debug.Log("Player is dead"); isDead = true; DeathTrigger = true; } else { return; } }
void Awake() { _internal = this; button.gameObject.SetActive(false); scrollRect.gameObject.SetActive(false); hero = GameObject.Find("Hero").GetComponent <FirstPersonAIO>(); }
private void Awake() { Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; _readingGuide = FindObjectOfType <ReadingGuide>(); _cameraReference = FindObjectOfType <FirstPersonAIO>(); _readingGuide.gameObject.SetActive(false); }
void Start() { MinTime = 5f; MaxTime = 10f; player = GameObject.FindGameObjectWithTag("Player"); playerhead = player.GetComponentInChildren <AudioListener>().transform.parent; playerController = player.GetComponentInParent <FirstPersonAIO>(); }
public void setSensitivity() { if (player == null) { player = GameObject.Find("FirstPerson-AIO").GetComponent <FirstPersonAIO>(); } player.mouseSensitivity = sensitivitySlider.value + 1; }
private void Start() { detection = GetComponent <PlayerEnemyInteraction>(); capsule = GetComponent <CapsuleCollider>(); groundNormal = Vector3.one; audioSource = GetComponent <AudioSource>(); firstPerson = GetComponent <FirstPersonAIO>(); playerRB = GetComponent <Rigidbody>(); }
private void OnTriggerExit(Collider other) { if (other.CompareTag("Player")) { FirstPersonAIO player = other.GetComponent <FirstPersonAIO>(); player.advanced.gravityMultiplier = 1f; //player.IsInWater = false; } }
private void Start() { buttonE = InGameAssetManager.i.buttonE; inventory = InGameAssetManager.i.inventory; isFlashLightOpening = InGameAssetManager.i.flashLight.enabled; AIO = GetComponent <FirstPersonAIO>(); inventoryBGColor = new Color(0, 0, 0, 0); InGameAssetManager.i.inventoryBG.color = inventoryBGColor; playerState = GetComponent <PlayerDying>(); }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { FirstPersonAIO player = other.GetComponent <FirstPersonAIO>(); player.advanced.gravityMultiplier = 0.7f; //player.IsInWater = true; _audioSource.Play(); } }
void Start() { playerUnder = false; interact = GameObject.Find("GameUI").transform.GetChild(0).GetComponent <TextMeshProUGUI>(); coll = GetComponent <BoxCollider>(); defaultRotationAngle = transform.localEulerAngles.x; currentRotationAngle = transform.localEulerAngles.x; closedSize = coll.size; closedCenter = coll.center; source = GetComponent <AudioSource>(); firstPersonScript = GameObject.FindGameObjectWithTag("Player").GetComponent <FirstPersonAIO>(); }
void Start() { player = FindObjectOfType <FirstPersonAIO>(); playerObjManip = player.GetComponent <ObjectManipulation>(); HeadJoint = GameObject.Find("HeadJoint").transform; currentLevel = 0; currentSection = 0; player.transform.position = levels[0].initPos; player.transform.eulerAngles = levels[0].initRot; HeadJoint.eulerAngles = levels[0].initRot; }
// Use this for initialization void Start() { Debug.Log("Transform Tag is: " + cameraTwo.tag); Debug.Log("Transform Tag is: " + cameraOne.tag); FirstPersonAIO1 = GameObject.Find("PinkGirl").GetComponent <FirstPersonAIO>(); FirstPersonAIO2 = GameObject.Find("CowBoy").GetComponent <FirstPersonAIO>(); //Get Camera Listeners cameraOneAudioLis = cameraOne.GetComponent <AudioListener>(); cameraTwoAudioLis = cameraTwo.GetComponent <AudioListener>(); //Camera Position Set cameraPositionChange(PlayerPrefs.GetInt("CameraPosition")); }
// Start is called before the first frame update void Start() { agent = GetComponent <NavMeshAgent>(); anim = GetComponent <Animator>(); player = GameObject.FindGameObjectWithTag("Player").transform; agent.speed = 1.2f; BossRb = GetComponent <Rigidbody>(); PlayerRb = player.GetComponent <Rigidbody>(); agent.updateRotation = false; capsule = player.GetComponent <CapsuleCollider>(); StartCoroutine(playGruntSound()); firstPerson = player.GetComponent <FirstPersonAIO>(); agent.updateRotation = true; previousPos = transform.position; }
private void Start() { if (!FindObjectOfType <SoundManager>().isPlaying("Music")) { FindObjectOfType <SoundManager>().PlayFade("Music"); } Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; numberOfCards = 0; currentHealth = maxHealth; objectiveScript = objective.GetComponent <Objectives>(); firstScript = GetComponent <FirstPersonAIO>(); firstScript.concreteFootSteps = concreteFootSteps; firstScript.grassFootSteps = grassFootSteps; firstScript.woodFootSteps = woodFootSteps; Invoke("escapeNotify", 5f); }
private void ResaturateObjects() { Object[] _allObjects = FindObjectsOfType <GameObject>(); foreach (GameObject obj in _allObjects) { FirstPersonAIO _hasControllerScript = obj?.GetComponent <FirstPersonAIO>(); MeshRenderer _hasMeshRenderer = obj?.GetComponent <MeshRenderer>(); Ignore _hasIgnoreScript = obj?.GetComponent <Ignore>(); Renderer _objRenderer = obj?.GetComponent <Renderer>(); if (_hasControllerScript == null) { if (_hasIgnoreScript == null) { if (_hasMeshRenderer != null && _objRenderer != null) { _objRenderer.material.color = ResaturateColors(_objRenderer); } } } } }
private void SaveObjectColor() { // create a dictionary and save unique instance id and color Object[] _allGameObjects = FindObjectsOfType <GameObject>(); foreach (GameObject obj in _allGameObjects) { FirstPersonAIO _hasControllerScript = obj?.GetComponent <FirstPersonAIO>(); MeshRenderer _hasMeshRenderer = obj?.GetComponent <MeshRenderer>(); Ignore _hasIgnoreComponent = obj?.GetComponent <Ignore>(); if (_hasControllerScript == null) { if (_hasMeshRenderer != null && _hasIgnoreComponent == null) { Renderer _checkColor = obj?.GetComponent <Renderer>(); _storedObjects.Add(obj); _redColorValues.Add(obj.GetInstanceID(), _checkColor.material.color.r); _greenColorValues.Add(obj.GetInstanceID(), _checkColor.material.color.g); _blueColorValues.Add(obj.GetInstanceID(), _checkColor.material.color.b); } } } }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { _cam.SetActive(true); _playerBehaviour = other.GetComponent <FirstPersonAIO>(); _playerBehaviour.Targetable = false; _playerBehaviour.playerCanMove = false; _playerBehaviour.lockAndHideCursor = false; _playerBehaviour.enableCameraMovement = false; Rigidbody rb = _playerBehaviour.gameObject.GetComponent <Rigidbody>(); _playerBehaviour.enabled = false; rb.velocity = Vector3.zero; rb.useGravity = false; Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; StartCoroutine(EnableMouse(110)); _director.Play(); } }
private void Awake() { camScript = GetComponent <FirstPersonAIO>(); //holdPosition = CenterRay().GetPoint(1f); }
void Start() { moveContr = GetComponent <FirstPersonAIO>(); }
// Awake is a built-in unity function that is called called only once during the lifetime of the script instance. // It is called after all objects are initialized. // For more info, see: void Awake() { rb = GetComponent <Rigidbody>(); firstPerson = GetComponent <FirstPersonAIO>(); SetMaxVelocity(maxVelocity); }
void Start() { firstPerson = GetComponent <FirstPersonAIO>(); }
// Start is called before the first frame update void Start() { text = GetComponent <Text>(); hero = GameObject.Find("Hero").GetComponent <FirstPersonAIO>(); }
private void Awake() { _playerScript = PlayerObject?.GetComponent <FirstPersonAIO>(); }
private void UpdatePlayerState(Collider other, bool state) { FirstPersonAIO player = other.GetComponent <FirstPersonAIO>(); player.Targetable = state; }
private void Awake() { _controllerSettings = _controller.GetComponent <FirstPersonAIO>(); }
private void Awake() { _controllerSettings = _controller.GetComponent <FirstPersonAIO>(); _audioManager = FindObjectOfType <AudioManager>(); }