public override void Initialize() { base.Initialize(); playerManager = GetComponentInParent <PlayerManager>(); inputHandler = GetComponentInParent <InputHandler>(); locomotion = GetComponentInParent <PlayerLocomotion>(); }
private void Awake() { //playerAtk = GetComponent<PlayerAtk>(); playerLocomotion = GetComponent <PlayerLocomotion>(); playerStats = GetComponent <PlayerStats>(); playerAtk = GetComponent <PlayerAtk>(); }
private void Awake() { inputManager = GetComponent <InputManager>(); animatorManager = GetComponentInChildren <AnimatorManager>(); cameraManager = FindObjectOfType <CameraManager>(); playerLocomotion = GetComponent <PlayerLocomotion>(); playerAttacker = GetComponent <PlayerAttacker>(); }
void Start() { inputHandler = GetComponent <InputHandler>(); anim = GetComponentInChildren <Animator>(); playerLocomotion = GetComponent <PlayerLocomotion>(); playerStats = GetComponent <PlayerStats>(); interactableUI = FindObjectOfType <InteractableUI>(); }
private static void Postfix(PlayerLocomotion __instance, PlayerLocomotion.PLOC_State state, bool wasWarpedIntoState = false) { if (!__instance.m_owner.IsLocallyOwned) { return; } PlayerLocomotionEvents.StateChanged(state); }
void Awake() { inputHandler = GetComponent <InputHandler>(); anim = GetComponentInChildren <Animator>(); locomotion = GetComponent <PlayerLocomotion>(); cameraHandler = FindObjectOfType <CameraHandler>(); interactableUI = FindObjectOfType <InteractableUI>(); }
public void Initialize() { playerManager = GetComponentInParent <PlayerManager>(); anim = GetComponent <Animator>(); inputHandler = GetComponentInParent <InputHandler>(); //dodge stuff playerLocomotion = GetComponentInParent <PlayerLocomotion>(); //dodge stuff vertical = Animator.StringToHash("Vertical"); horizontal = Animator.StringToHash("Horizontal"); }
private static void Postfix(PlayerLocomotion __instance) { if (!__instance.LocallyOwned) { return; } InjectFPSCameraForwardTweakForInteraction.useVRInteractionForward = false; InjectFPSCameraPositionTweakForInteraction.useInteractionControllersPosition = false; }
// Use this for initialization void Start() { rb = GetComponent <Rigidbody2D> (); pl = FindObjectOfType <PlayerLocomotion> (); audioclip = GetComponent <AudioSource> (); levelBar = FindObjectOfType <LevelUpBar> (); rb.velocity = new Vector2(Random.Range(minXSpeed, maxXSpeed), Random.Range(minYSpeed, maxYSpeed)); xSpeed = rb.velocity.x; ySpeed = rb.velocity.y; }
public void OnEnable() { if (inputActions == null) { inputActions = new PlayerLocomotion(); inputActions.PlayerMovement.Movement.performed += inputActions => movementInput = inputActions.ReadValue <Vector2>(); inputActions.PlayerAction.Shot.started += inputActions => StartShooting(); inputActions.PlayerAction.Shot.canceled += inputActions => StopShooting(); } inputActions.Enable(); }
// Use this for initialization void Start() { //Debug.Log ("minScaleX: " + minScaleX + ", maxScaleX: " + maxScaleX + ", minScaleY: " + minScaleY + ", maxScaleY: " + maxScaleY); rb = GetComponent <Rigidbody2D> (); pl = GetComponent <PlayerLocomotion> (); //bc = GetComponent<BoxCollider2D> (); maxXSpeed = pl.GetMaxXSpeed(); maxYSpeed = pl.GetMaxYSpeed(); Debug.Log(maxYSpeed); }
private void Awake() { animator = GetComponentInChildren <Animator>(); inputManager = GetComponentInParent <InputManager>(); playerManager = GetComponentInParent <PlayerManager>(); playerLocomotion = GetComponentInParent <PlayerLocomotion>(); playerStats = GetComponentInParent <PlayerStats>(); //pause = GetComponentInChildren<PauseMenu>(); horizontal = Animator.StringToHash("Horizontal"); vertical = Animator.StringToHash("Vertical"); }
public PlayerCharacter(PlayerID id, CharacterAvatar avatar) : base(avatar) { ID = id; Input = new PlayerInput(this); Locomotion = new PlayerLocomotion(this); InteractionDetection = new PlayerInteractDetection(this); Hand = avatar.GetComponentInChildren <PlayerHand>(); Score = new PlayerScore(); Time = new PlayerTime(); Reset(); Time.Start(); }
private void PickUpWeapon(PlayerManager playerManager) { PlayerInventory playerInventory = playerManager.GetComponent <PlayerInventory>(); PlayerLocomotion playerLocomotion = playerManager.GetComponent <PlayerLocomotion>(); PlayerAnimatorHandler animatorHandler = playerManager.GetComponentInChildren <PlayerAnimatorHandler>(); playerLocomotion.rigid.velocity = Vector3.zero; animatorHandler.PlayTargetAnimation(PlayerAnimatorHandler.hashPickUpItem, true); playerInventory.weaponsInventory.Add(weapon); playerManager.itemInteractableGO.SetActive(true); playerManager.itemInteractableGO.GetComponentInChildren <UnityEngine.UI.Text>().text = weapon.name; Destroy(gameObject); }
private void Start() { if (tutorial == null) { gameObject.SetActive(false); } else { player = GameObject.FindGameObjectsWithTag("Player"); myplayer = player[0]; playerLocomotion = myplayer.GetComponent <PlayerLocomotion>(); ms = playerLocomotion.movementSpeed; Rs = playerLocomotion.sprintSpeed; tutHandler = tutorial.GetComponent <tutorialHandler>(); } }
public void Update() { if (Input.GetKeyDown(KeyCode.F1)) { if (!FreecamEnabled) { FPSCameraHolder fpsCamHolder = GameObject.FindObjectOfType <FPSCameraHolder>(); FPSCamera fpsCamera = GameObject.FindObjectOfType <FPSCamera>(); //fpsCamera.gameObject.transform.GetChild(1)?.gameObject.SetActive(false); //UI_Apply ui = GameObject.FindObjectOfType<UI_Apply>(); //ui.enabled = false; //fpsCamHolder.m_flatTrans.gameObject.SetActive(false); player = fpsCamHolder.m_owner.gameObject; PlayerLocomotion = player.GetComponent <PlayerLocomotion>(); PlayerLocomotion.enabled = false; //Global.EnemyPlayerDetectionEnabled = false; } else { //FPSCameraHolder fpsCam = GameObject.FindObjectOfType<FPSCameraHolder>(); //fpsCam.m_flatTrans.gameObject.SetActive(true); // //FPSCamera fpsCamera = GameObject.FindObjectOfType<FPSCamera>(); //fpsCamera.gameObject.transform.GetChild(1)?.gameObject.SetActive(true); PlayerLocomotion.enabled = true; //Global.EnemyPlayerDetectionEnabled = true; //UI_Apply ui = GameObject.FindObjectOfType<UI_Apply>(); //ui.enabled = true; } FreecamEnabled = !FreecamEnabled; FreecamMain.log.LogMessage(FreecamEnabled == true ? "Freecam Enabled" : "Freecam Disabled"); } if (FreecamEnabled) { UpdateMovement(); PlayerLocomotion.m_owner.m_movingCuller.UpdatePosition(player.transform.position); PlayerLocomotion.m_owner.Sync.SendLocomotion(PlayerLocomotion.m_currentStateEnum, player.transform.position, PlayerLocomotion.m_owner.FPSCamera.Forward, 0, 0); } }
private void Awake() { playerAttacker = GetComponent <PlayerAttacker>(); playerInventory = GetComponent <PlayerInventory>(); playerManager = GetComponent <PlayerManager>(); tutorial = FindObjectOfType <tutorialHandler>(); playerEffectsManager = GetComponentInChildren <PlayerEffectsManager>(); playerAnimatorManager = GetComponentInChildren <AnimatorHandler>(); weaponSlotManager = GetComponentInChildren <WeaponSlotManager>(); playerLocomotion = GetComponent <PlayerLocomotion>(); playerStats = GetComponent <PlayerStats>(); cameraHolder = FindObjectOfType <CameraHolder>(); UIManager = FindObjectOfType <UIManager>(); help_input = false; }
void Start() { player = GameObject.FindGameObjectsWithTag("Player"); myplayer = player[0]; PlayerStats = myplayer.GetComponent <PlayerStats>(); playerManager = myplayer.GetComponent <PlayerManager>(); playerLocomotion = myplayer.GetComponent <PlayerLocomotion>(); ms = playerLocomotion.movementSpeed; playerLocomotion.movementSpeed = 0; Rs = playerLocomotion.sprintSpeed; playerLocomotion.sprintSpeed = 0; posicionActual = new PositionData(myplayer.transform.position, myplayer.transform.rotation); cajasmonedas.SetActive(false); subtitles.SetActive(true); Timert = 0; fase = -1; faseAnterior = -1; hapasao = false; isJumping = true; }
// Start is called before the first frame update void Start() { FLAGGuende = false; FLAGFuego = false; maxHealth = SetMaxHealthFromHelathLevel(); // set la vida maxima que tendra el personaje dependido del healthLevel currentHealth = maxHealth; //indico al iniciar que la vida esta al maximo extraHealth = 0; extraHealthActive = false; healthBar.SetMaxHealth(maxHealth); //le indico a la barra de saluda su valor //stamina maxStamina = SetMaxStaminaFromStaminaLevel(); //recoger stamina amxima staminaBar.SetMaxStamina(Mathf.RoundToInt(maxStamina)); //inicializar valor maximo stamina currentStamina = maxStamina; //inicializar al principio el stamina maximo //monedas moneyBar = FindObjectOfType <MoneyBar>(); BarraMonedas.SetActive(false); contadorMonedas = 0; playerManager = GetComponent <PlayerManager>(); playerLocomotion = GetComponent <PlayerLocomotion>(); normalSpeed = playerLocomotion.movementSpeed; rollSpeed = playerLocomotion.sprintSpeed; }
private void Awake() { inputManager = GetComponent <InputManager>(); playerLocomotion = GetComponent <PlayerLocomotion>(); cameraManager = FindObjectOfType <CameraManager>(); }
public void Setup(PlayerLocomotion agentLocomotion, PostProcessingBehaviour postprocess) { m_playerLocomotion = agentLocomotion; postProcessing = postprocess; }
private void Awake() { inputManager = GetComponent <InputManager>(); playerLocomotion = GetComponent <PlayerLocomotion>(); }
private void Start() { playerManager = GetComponent <PlayerManager>(); playerLocomotion = GetComponent <PlayerLocomotion>(); Anim = GetComponent <Animator>(); }
private void Awake() { animatorManager = GetComponentInChildren <AnimatorManager>(); playerLocomotion = GetComponent <PlayerLocomotion>(); playerAttacker = GetComponent <PlayerAttacker>(); }
void Start() { m_locomotion = GetComponent <PlayerLocomotion>(); }