private void SetUpData_LOCAL_NONLOCAL() { if (photonView.IsMine) { PlayerCamera.transform.SetParent(null, false); cameraController = PlayerCamera.GetComponent <PlayerCameraController>(); cameraController.m_XOffset = cameraOffset; _object = GetComponent <GeneralController>(); moveStick = FindObjectOfType <MoveStick>(); attackStick = FindObjectOfType <AttackStick>(); specialStick = FindObjectOfType <SpecialStick>(); jumpButton = FindObjectOfType <Joybutton>(); SpecialCanvas = GameObject.Find("Canvas - Special"); SpecialMeterCanvas = GameObject.Find("Canvas - SpecialMeter"); specialMeter = GameObject.Find("Special Meter").GetComponent <Image>(); SpecialCanvas.SetActive(false); PlayerNameText.text = PhotonNetwork.LocalPlayer.NickName; PlayerNameText.color = Color.green; } else { PlayerCamera.SetActive(false); PlayerNameText.text = photonView.Owner.NickName; PlayerNameText.color = Color.red; } }
// Use this for initialization void Start() { consoleCanvas.enabled = isOpen; DevConsole.ConsoleDaemon.Instance.OnClearConsole.AddListener(ClearConsole); cameraController = (cameraController == null) ? GameObject.Find(Literals.OBJECT_PLAYER_CAM).GetComponent <PlayerCameraController>() : cameraController; Assert.IsNotNull(cameraController, "Console has no camera controller attached, and could not find one in scene."); }
void Start() { //Timers bhopLenTimer = gameObject.AddComponent <Timer>(); bhopLenTimer.SetTime(bhopLeniency); wallBanTimer = gameObject.AddComponent <Timer>(); wallBanTimer.SetTime(wallBanTime); wallDetachTimer = gameObject.AddComponent <Timer>(); wallDetachTimer.SetTime(0.2f); wallrunTimer = gameObject.AddComponent <Timer>(); wallrunTimer.SetTime(wallrunTime); jumpTimer = gameObject.AddComponent <Timer>(); jumpTimer.SetTime(0.05f); //GameObjects camCon = cam.GetComponent <PlayerCameraController>(); height = transform.GetChild(0).GetComponent <Renderer>().bounds.size.y; rb = GetComponent <Rigidbody>(); pm = GetComponent <CapsuleCollider>(); camCon.SetTilt(0); //Setting up beggining state EnterFlying(); canDJump = true; pm.material.dynamicFriction = 0; pm.material.frictionCombine = PhysicMaterialCombine.Minimum; }
private void validateConfiguration() { connectedCamera = GameObject.Find(Literals.OBJECT_PLAYER_CAM).GetComponent(typeof(PlayerCameraController)) as PlayerCameraController; Assert.IsNotNull(connectedCamera, "Main menu missing camera connection"); rootLayout = GameObject.Find(Literals.OBJECT_DESIRE_ROOT); Assert.IsNotNull(rootLayout, "Unable to locate Desire menu root"); }
// Use this for initialization void Start() { //_PlayerCameraController = transform.parent.GetComponent<PlayerCameraController>(); if (CycleRoomCameraController != null){ _PlayerCameraController = CycleRoomCameraController.GetComponent<PlayerCameraController>(); TriggerZone = this.transform; }else{Debug.LogError("Link the CycleRoomCameraController to the "+ transform.name +" Object in the Inspector");} }
// Use this for initialization void Start() { mShoulderJoint = GetComponentInChildren <PlayerCameraController>(); if (mShoulderJoint == null) { Debug.LogError("Could not locate shoulder joint object. Ensure that a PlayerCharacterController exists in the hierarchy."); } }
void Start() { cc = Camera.GetComponent <PlayerCameraController>(); tapCount = 0; MaxDubbleTapTime = 0.12f; lastTouchPos = new Vector2(0f, 0f); positionRange = 40f; }
private void Start() { localPlayerTransform = PlayerNetwork.LocalPlayer.transform; playerCamera = localPlayerTransform.GetComponent <PlayerCameraController>(); PlayerNetwork.OnOtherPlayerCreated += OnOtherPlayerCreated; StartCoroutine(UpdateIndicators()); }
// Use this for initialization void Start() { respawnPoint = this.transform.position; rb = this.gameObject.GetComponent<Rigidbody>(); boxCollider = this.gameObject.GetComponent<SphereCollider>(); cameraController = this.gameObject.GetComponent<PlayerCameraController>(); }
void Start() { _cameraController = GetComponentInChildren <PlayerCameraController>(); _movementController = GetComponent <PlayerMovementController>(); _jumpController = GetComponent <PlayerJumpController>(); _attackController = GetComponent <PlayerAttackController>(); Cursor.visible = false; }
// For use with MultiplayerManager public void Setup(Player p, PlayerCameraController camCtrl, PlayerCanvasController pc) { playerMasterRef = p; p.controller = this; pCameraController = camCtrl; pCameraController.player = this; controls = p.controls; canvas = pc; canvas.Setup(camCtrl.cam); }
private void Awake() { agent = GetComponent <NavMeshAgent>(); rigidbodyComponent = GetComponent <Rigidbody>(); animator = GetComponent <Animator>(); cameraController = GetComponent <PlayerCameraController>(); stats = GetComponent <PlayerStatsComponent>(); combatController = GetComponent <PlayerCombatController>(); inventory = GetComponent <Inventory>(); }
private void Start() { mState = PlayerState.Walk; mCharacterController = GetComponent <CharacterController>(); mPlayerMovement = GetComponent <PlayerMovement>(); mPlayerCameraController = GetComponent <PlayerCameraController>(); mRoll = GetComponent <PlayerRoll>(); // Axis inversion }
// Use this for initialization void Start() { rb = GetComponent <Rigidbody>(); cameraController = GetComponent <PlayerCameraController>(); animController = GetComponent <PlayerAnimationController>(); playerMain = GetComponent <PlayerMain>(); SetupRolls(); glideStamina = playerMain.maxGlideStamina; }
/// <summary> /// Releasea the player from the station /// </summary> public virtual void ReleasePlayerFromStation() { if (playerInStation != null) { isActivated = false; playerInStation.ReturnControlToCharacter(); playerInStation.ReattachCameraToPlayer(); playerInStation = null; stationCamera = null; } }
void Start() { moveController = GetComponent <MovementController>(); cameraController = GetComponent <PlayerCameraController>(); orderState = MovementState.Running; moveController.Direction = Vector3.zero; moveController.Crouching = false; Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; }
private void Awake() { thisRb = GetComponent <Rigidbody>(); camController = GetComponent <PlayerCameraController>(); thisAnimator = GetComponent <Animator>(); gun = GetComponent <GunBase>(); mainCam = Camera.main; sprintEffect.emitting = false; sprintAnimHash = Animator.StringToHash("isSprinting"); crouchAnimHash = Animator.StringToHash("isCrouching"); }
private void OnEnable() { if (photonView.isMine) { enabled = false; return; } CreateNameTag(); cameraController = PlayerNetwork.LocalPlayer?.GetComponent <PlayerCameraController>(); objectHeight = gameObject?.GetComponent <Collider>()?.bounds.size.y * 2 ?? 0f; }
// Use this for initialization void Start() { //_PlayerCameraController = transform.parent.GetComponent<PlayerCameraController>(); if (CycleRoomCameraController != null) { _PlayerCameraController = CycleRoomCameraController.GetComponent <PlayerCameraController>(); TriggerZone = this.transform; } else { Debug.LogError("Link the CycleRoomCameraController to the " + transform.name + " Object in the Inspector"); } }
protected override void Interaction(PlayerCameraController player) { if (!player.background.activeSelf) { player.background.SetActive(true); InputField message = player.textMessage.GetComponent <InputField>(); message.lineType = InputField.LineType.MultiLineNewline; message.text = information; } else { player.background.SetActive(false); } }
protected override void Interaction(PlayerCameraController player) { Debug.Log("Object Interacted"); Renderer rend = GetComponent <Renderer>(); if (rend.material.color == Color.red) { rend.material.SetColor("_Color", Color.white); } else { rend.material.SetColor("_Color", Color.red); } }
void Start() { NomaiVR.Log("Start PlayerBodyPosition"); // This component is messing with our ability to read the VR camera's rotation. // Seems to be responsible for controlling the camera rotation with the mouse / joystick. PlayerCameraController playerCameraController = Camera.main.GetComponent <PlayerCameraController>(); if (playerCameraController) { playerCameraController.enabled = false; } SetupCamera(); }
private static void SwitchCamera <T>() where T : FreeCamera { bool disabled = EmuInstance.Player.PointOfView == EPointOfView.FirstPerson; EmuInstance.Player.PointOfView = disabled ? EPointOfView.FreeCamera : EPointOfView.FirstPerson; PlayerCameraController playerCameraController = EmuInstance.Player.gameObject.GetComponent <PlayerCameraController>(); T freeCamera = playerCameraController.Camera.gameObject.GetOrAddComponent <T>(); if (!disabled) { Object.Destroy(freeCamera); } ReplaceHealthController(); }
// Token: 0x060001D7 RID: 471 RVA: 0x0000F20C File Offset: 0x0000D40C private void ShootPlayer() { RagdollSettings simulatedRagdoll = this.vehicle.playerControlling.simulatedRagdoll; Transform transform = simulatedRagdoll.bodyElements.ragdollJoints[0].transform; PlayerCameraController playerCameraController = this.vehicle.playerControlling.playerCameraController; simulatedRagdoll.RagdollModeEnabled = true; simulatedRagdoll.ResetRagdoll(); transform.eulerAngles = new Vector3(this.canonBarrel.eulerAngles.x + 90f, this.canonBarrel.eulerAngles.y, this.canonBarrel.eulerAngles.z); transform.position = this.BarrelEnd; for (int i = 0; i < simulatedRagdoll.rigidbodyChildren.Length; i++) { simulatedRagdoll.rigidbodyChildren[i].AddForce(this.canonBarrel.forward * this.shootStrength, ForceMode.Impulse); } playerCameraController.ResetLookRotation(new Vector3(0f, transform.eulerAngles.y, 0f)); }
private IEnumerator FollowMouse() { PlayerCameraController playerCameraController = PlayerNetwork.LocalPlayer.GetComponent <PlayerCameraController>(); Transform playerTransform = PlayerNetwork.LocalPlayer.transform; Material buildingGrid = GetComponent <Renderer>().sharedMaterial; while (buildableToBuild != null) { Ray ray = playerCameraController.CameraReference.ScreenPointToRay(new Vector3(Input.mousePosition.x, Input.mousePosition.y, 0f)); RaycastHit hitInfo; if (Physics.Raycast(ray, out hitInfo, 1000f, layerMask.value)) { Vector3 newPosition = hitInfo.point; if (buildableData.SnapToGrid) { // Calculate X positon float xSpacing = Mathf.Abs(newPosition.x % gridSpacing); float xPosition = xSpacing >= (gridSpacing / 2) ? gridSpacing - xSpacing : xSpacing * -1; // Calculate Z position float zSpacing = Mathf.Abs(newPosition.z % gridSpacing); float zPosition = zSpacing >= (gridSpacing / 2) ? gridSpacing - zSpacing : zSpacing * -1; // Store the position newPosition.x += newPosition.x >= 0 ? xPosition : xPosition * -1; newPosition.z += newPosition.z >= 0 ? zPosition : zPosition * -1; } // Apply the position buildableToBuild.transform.position = newPosition; //Update the building grid transform.position = newPosition; buildingGrid.SetVector("_Point", newPosition); if (ConfirmBuildingConditions()) { gridRenderer.sharedMaterial.SetColor("_GridColor", (buildableData.SnapToGrid ? gridSnappingActiveColor : gridSnappingInactiveColor)); } else { gridRenderer.sharedMaterial.SetColor("_GridColor", gridOutOfRangeColor); } } yield return(null); } }
void Start() { ikController = GetComponent <IKController>(); ikController.setIKActive(true, enabledIKGoals); ikCatchController = GetComponent <IKCatchController>(); ikCatchController.setActive(true); ikDeflectController = GetComponent <IKDeflectController>(); ikDeflectController.setActive(true); ikThrowController = GetComponent <IKThrowController>(); playerCameraController = GetComponent <PlayerCameraController>(); animator = GetComponent <Animator>(); }
public void RpcSetupGun(int setAmmo, int setReserve) { if (!hasAuthority) { return; } playMove = gameObject.GetComponentInParent <SurfCharacter>(true); ammoDisplay = playMove.transform.GetComponent <AmmoDisplay>(); roundManager = GameObject.Find("Canvas_PublicUI(Clone)").transform.GetComponent <UITimeManager>(); mainCamera = playMove.transform.GetComponentInChildren <CinemachineVirtualCamera>(); ammo = setAmmo; reserve = setReserve; scopeOverlay = playMove.gameObject.FindComponentInChildWithTag <Image>("Scope").gameObject; mouseLook = playMove.transform.GetComponent <PlayerCameraController>(); crosshair = playMove.gameObject.FindComponentInChildWithTag <Image>("Crosshair").gameObject; animator = transform.GetComponent <Animator>(); isSetup = true; }
public void Awake() { // Cache GameObject properties _gameObject = gameObject; // Find Player within the scene _player = FindObjectOfType <Player>(); if (_player == null) { Debug.LogWarning(string.Format("({0}) Unable to find any Player within the scene", this.name)); } // Find Player Camera Controller within the scene _playerCameraController = FindObjectOfType <PlayerCameraController>(); if (_playerCameraController == null) { Debug.LogWarning(string.Format("({0}) Unable to find any Player Camera Controller within the scene", this.name)); } // Initialise dialogue list array if (_dialogueList == null || _dialogueList.transform.childCount < 1) { Debug.LogError(string.Format(@"({0}) Dialogue list not set correctly. Please ensure there is at least 1 child of the dialogue object", this.name)); } else { // Get array of Dialogue _dialogueArray = _dialogueList.GetComponentsInChildren <Dialogue>(); if (_dialogueArray == null || _dialogueArray.Length <= 0) { Debug.LogWarning(string.Format("({0}) Unable to find any dialogue messages", this.name)); } // Disable all dialogue messages, except the first message for (int i = 1; i < _dialogueArray.Length; ++i) { _dialogueArray[i].gameObject.SetActive(false); } } }
public void Awake() { // Cache GameObject properties _gameObject = gameObject; // Find Player within the scene _player = FindObjectOfType<Player>(); if (_player == null) { Debug.LogWarning(string.Format("({0}) Unable to find any Player within the scene", this.name)); } // Find Player Camera Controller within the scene _playerCameraController = FindObjectOfType<PlayerCameraController>(); if (_playerCameraController == null) { Debug.LogWarning(string.Format("({0}) Unable to find any Player Camera Controller within the scene", this.name)); } // Initialise dialogue list array if (_dialogueList == null || _dialogueList.transform.childCount < 1) { Debug.LogError(string.Format(@"({0}) Dialogue list not set correctly. Please ensure there is at least 1 child of the dialogue object", this.name)); } else { // Get array of Dialogue _dialogueArray = _dialogueList.GetComponentsInChildren<Dialogue>(); if (_dialogueArray == null || _dialogueArray.Length <= 0) { Debug.LogWarning(string.Format("({0}) Unable to find any dialogue messages", this.name)); } // Disable all dialogue messages, except the first message for (int i = 1; i < _dialogueArray.Length; ++i) { _dialogueArray[i].gameObject.SetActive(false); } } }
void Initialize() { //Don't execute if not the local player if (!isLocalPlayer) { return; } //If the playerCameraController reference is null, create the player if (playerCameraController == null) { playerCameraController = Instantiate(playerCameraControllerPrefab).GetComponent <PlayerCameraController>(); playerCameraController.playerBody = this; playerCameraController.SetFollowTarget(transform); } //If the playerUIManager reference is null, create the canvas if (playerUIManager == null) { playerUIManager = Instantiate(playerUIManagerPrefab).GetComponent <PlayerUIManager>(); playerUIManager.playerBody = this; //playerUIManager.playerCamera = playerCameraController.activeCam; } //If the audioManager reference is null, create the canvas if (audioManager == null) { audioManager = Instantiate(audioManagerPrefab).GetComponent <AudioManager>(); audioManager.playerBody = this; } //If the playerBody reference is null, create the player if (playerController == null) { playerController = Instantiate(playerControllerPrefab, Vector3.zero, Quaternion.identity).GetComponent <PlayerController>(); playerController.playerBody = this; playerController.playerCameraController = playerCameraController; playerController.playerUIManager = playerUIManager; //playerController.CallOnEnable(); <--- Replaced by Start() } }
void Awake() { movementController = GetComponent <PlayerMovementController>(); animationController = GetComponent <PlayerAnimationController>(); actionsController = GetComponent <PlayerActionsController>(); cameraControl = GetComponent <PlayerCameraController>(); entityTarget = this.GetComponentInChildren <EntityTargetingSystem>(); uiControl = GameObject.Find("UI").GetComponent <GameUIControl>(); weaponInst = new ItemInstance(); weaponInst.itemID = baseWeapon.itemID; weaponInst.quality = baseQuality; attackAction = GetWeapon().attackDetails; armorInst = new ItemInstance(); armorInst.itemID = baseArmor.itemID; armorInst.quality = baseQuality; artifactInst = new ItemInstance(); artifactInst.itemID = baseArtifact.itemID; artifactInst.quality = baseQuality; }
void Start() { try { foreach (var item in PrevGameObjects) { PrevCircuitComponents.Add(item.GetComponent <ICircuitComponent>()); } foreach (var item in NextGameObjects) { NextCircuitComponents.Add(item.GetComponent <ICircuitComponent>()); } } catch (Exception) { Debug.Log("CircuitComponent List has a none ICircuitComponent."); } UPlayer = UnityEngine.Object.FindObjectOfType(typeof(UniquePlayerCTRL)) as UniquePlayerCTRL; _cameraController = UnityEngine.Object.FindObjectOfType(typeof(PlayerCameraController)) as PlayerCameraController; _mySR = GetComponentInParent <SpriteRenderer>(); SetHighlight(false); }
// Start is called before the first frame update void Start() { vca_mus = FMODUnity.RuntimeManager.GetVCA("vca:/Music"); vca_sfx = FMODUnity.RuntimeManager.GetVCA("vca:/SFX"); //Load volume settings if (PlayerPrefs.HasKey("MusicVolume")) { vca_mus.setVolume(PlayerPrefs.GetFloat("MusicVolume")); } else { vca_mus.setVolume(1.0f); } if (PlayerPrefs.HasKey("SFXVolume")) { vca_sfx.setVolume(PlayerPrefs.GetFloat("SFXVolume")); } else { vca_sfx.setVolume(1.0f); } //Load Mouse settings if (PlayerPrefs.HasKey("MouseAcceleration")) { PlayerCameraController.SetMouseAccel(PlayerPrefs.GetInt("MouseAcceleration") == 1); } if (PlayerPrefs.HasKey("MouseSensitivity")) { PlayerCameraController.SetMouseSens(PlayerPrefs.GetFloat("MouseSensitivity")); } GameObject pausePanelObj = GameObject.Find("PauseMenu"); if (pausePanelObj != null) { pausePanel = pausePanelObj.GetComponent <CanvasGroup>(); } GameObject hudObj = GameObject.Find("HUD"); if (hudObj != null) { hud = hudObj.GetComponent <CanvasGroup>(); } pauseOpen = false; curMenu = hud; if (!isMainMenu) { Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; } else { Cursor.visible = true; Cursor.lockState = CursorLockMode.None; } }