void DestroyProjectileAndTwin(PlayerAim playerAim) { soundObject = Instantiate(SoundObject, transform.position, Quaternion.identity) as GameObject; if(soundObject.audio != null) { soundObject.audio.Stop(); soundObject.audio.volume = 0.2f; soundObject.audio.pitch = 0.75f; soundObject.audio.clip = AudioManager.Instance.DiscGrab; soundObject.audio.Play(); } if (IsOriginal) playerAim.CurrentShotAmount++; Destroy(gameObject); }
public void Awake() { m_orbiter = GetComponent <PlayerAllyOrbiter>(); m_aim = GetComponent <PlayerAim>(); ms_interactLayer = LayerMask.NameToLayer("Interactable"); }
public void Start() { m_motor = GetComponent <PlayerMotor>(); m_launchable = GetComponent <Launchable>(); m_aim = GetComponent <PlayerAim>(); m_skillController = GetComponent <PlayerSkillController>(); }
private void Start() { Health = GetComponent <PlayerHealth>(); Movement = GetComponent <PlayerMovement>(); Aim = GetComponent <PlayerAim>(); Killer = GameObject.FindGameObjectWithTag("PlayerKiller").GetComponent <PlayerKiller>(); }
private void Start() { if (transform.parent.gameObject.GetComponent <PlayerAim>()) { pa = transform.parent.gameObject.GetComponent <PlayerAim>(); } }
void Start() { this.health = this.maxHealth; this.weapon = this.GetComponent <BaseWeapon>(); playerAim = this.GetComponent <PlayerAim>(); }
void Start() { playerAim = GetComponent <PlayerAim>(); playerRegularAttack = GetComponent <PlayerRegularAttack>(); animator = GetComponentInChildren <Animator>(); controller = GetComponent <CharacterController>(); }
public void StartNewCooldown(float duration, PlayerAim sender) { Task.Factory.StartNew(async() => { await Task.Delay((int)(duration * 1000)); sender.IsOffCooldown = true; }); }
public void Start() { m_aim = GetComponent <PlayerAim>(); m_motor = GetComponent <PlayerMotor>(); m_motion = GetComponent <MotionBuffer>(); m_launchable = GetComponent <Launchable>(); }
void Awake() { aim = FindObjectOfType <PlayerAim>(); life = FindObjectOfType <PlayerLife>(); //pupil = FindObjectOfType<ShieldPupil>(); ball = FindObjectOfType <Ball>(); }
void Start() { camRack = Camera.main.transform.parent; playerController = GetComponent <PlayerController>(); gunController = GetComponent <GunController>(); playerAim = GetComponent <PlayerAim>(); }
private void Awake() { instance = this; playerBase = gameObject.GetComponent <CharacterAim_Base>(); healthSystem = new HealthSystem(100); SetStateNormal(); }
/// <summary> /// Returns a Vector3 for the camera offset based on where the currently controlled squad member is aiming. /// </summary> private Vector3 GetAimOffset() { if (_aimOffsetDistance > 0) { // Get a reference to the current squaddie's aim script SquaddieController currentSquaddie = stSquadManager.GetCurrentSquaddie; if (currentSquaddie) { PlayerAim aimScript = currentSquaddie.gameObject.GetComponent <PlayerAim>(); if (aimScript) { // Get aim point if (aimScript.IsAiming) { Vector3 aimPoint = aimScript.GetAimMousePoint; Vector3 offsetPoint = aimPoint - currentSquaddie.transform.position; // Get offset & track for next frame Vector3 offset = offsetPoint * Mathf.Clamp01(_aimOffsetDistance); _previousAimOffset = offset; return(offset); } else { return(_previousAimOffset); } } } } return(Vector3.zero); }
private void Awake() { guiManager = FindObjectOfType <GUIManager>(); playerAim = GetComponentInParent <PlayerAim>(); gunEffect = GetComponent <GunEffect>(); AddAmmo(0); }
private void Start() { pMove = GetComponent <PlayerMovement>(); pAim = GetComponent <PlayerAim>(); lookDir = Quaternion.LookRotation(pAim.GetAimDirection()); moveDir = Quaternion.LookRotation(pMove.GetMoveDirection()); aniCon = GetComponentInChildren <Animator>(); }
// Start is called before the first frame update void Awake() { animator = GetComponentInChildren <Animator>(); rb = GetComponent <Rigidbody>(); playerInput = GameManager.Instance.InputController; player = GetComponent <Player>(); m_PlayerAim = player.playerAim; }
private void Start() { _buttonEvent = FindObjectOfType <ButtonEvent>(); _buttonEvent.OnRotated.AddListener(InvokeRotation); _posCorrector = GetComponent <PlayerPositionCorrector>(); _playerAim = GetComponent <PlayerAim>(); _sideDetector = GetComponent <SideDetector>(); }
public void Awake() { m_motion = GetComponent <MotionBuffer>(); m_animator = GetComponent <Animator>(); m_aim = GetComponent <PlayerAim>(); m_animWalkingSpeed = Animator.StringToHash(ANIM_WALKING_SPEED); }
// Use this for initialization void Start() { playerControl = InputManager.ActiveDevice; playerMovement = GetComponent <PlayerMove> (); playerHealth = GetComponent <PlayerHealth> (); int temp = InputManager.Devices.Count; if (name == "Player1") { if (temp < 1) { return; } playerControl = InputManager.Devices [0]; playerAim = GameObject.Find("Guide1").GetComponent <PlayerAim> (); playerNumber = 1; } if (name == "Player2") { if (temp < 2) { return; } playerControl = InputManager.Devices [1]; playerAim = GameObject.Find("Guide2").GetComponent <PlayerAim> (); playerNumber = 2; } if (name == "Player3") { if (temp < 3) { return; } playerControl = InputManager.Devices [2]; playerAim = GameObject.Find("Guide3").GetComponent <PlayerAim> (); playerNumber = 3; } if (name == "Player4") { if (temp < 4) { return; } playerControl = InputManager.Devices[3]; playerAim = GameObject.Find("Guide4").GetComponent <PlayerAim>(); playerNumber = 4; } possessedBall.transform.position = this.transform.position; this.rigidbody.velocity = Vector3.zero; isBallPossessed = true; playerColor = this.renderer.material.color; }
void Start() { playerAim = GetComponent <PlayerAim>(); playerRegularAttack = GetComponent <PlayerRegularAttack>(); animator = GetComponentInChildren <Animator>(); controller = GetComponent <CharacterController>(); Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; }
private void Awake() { playerAim = gameObject.GetComponent <PlayerAim>(); playerController = gameObject.GetComponent <PlayerController>(); playerControllerAndroid = gameObject.GetComponent <PlayerControllerAndroid>(); playerEffectStatus = gameObject.GetComponent <PlayerEffectStatus>(); playerLife = gameObject.GetComponent <PlayerLife>(); playerMovement = gameObject.GetComponent <PlayerMovement>(); }
private void Start() { _playerAim = GetComponent <PlayerAim>(); _shootButton = FindObjectOfType <ButtonEvent>(); _shootButton.OnShoot.AddListener(Shoot); _ammoText = GameObject.FindGameObjectWithTag("AmmoInfo").GetComponent <TextMeshProUGUI>(); _objectPoolManager = FindObjectOfType <ObjectPoolManager>(); _shootingMetadata = new ShootingMetadata(); UpdateAmmoText(); }
[HideInInspector] public PlayerThrow m_Throw; //esto son para poder habilitar y deshabilitar el control una vez que se realizo un lanzamiento, aun que dberia hacerlo de forma iterna public void Setup() //para establecer las referencias y valores inicales //m_Player = Instantiate(m_PlayerPrefab, m_SpawnPosition.position, m_SpawnPosition.rotation) as GameObject;//esta es para la forma 2//sin embargo este escript no es hernecia de MonoBehavior, por lo tanto no tengo la funcion Instantiate, por eso la forma 2 no funciona { m_ColoredPlayerText = "<color=#" + ColorUtility.ToHtmlStringRGB(m_PlayerColor) + ">Jugador " + m_PlayerNumber + "</color>";//parecidoa html m_FinLanzamiento = false; m_Aim = m_Player.GetComponent <PlayerAim>(); m_Throw = m_Player.GetComponent <PlayerThrow>(); m_Throw.m_PlayerNumber = m_PlayerNumber; m_Player.SetActive(false);//todos los jugadores deben iniciar inactivos, los cativara y desactivara el gamemanager cuadno seasu turno }
private void Awake() { characterAimBase = GetComponent <CharacterAim_Base>(); playerAim = GetComponent <PlayerAim>(); playerBase = GetComponent <Player_Base>(); playerPunch = GetComponent <PlayerPunch>(); playerBase.enabled = false; playerPunch.enabled = false; }
// Start is called before the first frame update void Start() { //anim = GetComponent<Animator>(); //anim.speed = 2.5f; playerAim = GetComponent <PlayerAim>(); nextFire = 0; canShoot = false; movingToCover = false; }
void Start() { _camControl = FindObjectOfType <CameraControl>(); _inputHandler = FindObjectOfType <InputHandler>(); _playerManipulationArea = FindObjectOfType <PlayerManipulationArea>(); _playerAim = GetComponent <PlayerAim>(); _playerGravity = GetComponent <PlayerGravity>(); _playerAnimation = GetComponentInChildren <PlayerAnimation>(); ChangeSkillMode(); }
public override void Initialize() { hp = player.GetComponent <Health>(); aimDir = player.GetComponent <PlayerAim>(); bulletOrigin = player.transform.Find(firePointName); // Given fire point name is invalid, default the bullet origin to the player's transform if (!bulletOrigin) { bulletOrigin = player.transform; } }
public void Start() { QuickBoltPrefab.CreatePool(10); StunBoltPrefab.CreatePool(2); m_motor = GetComponent <PlayerMotor>(); m_motion = GetComponent <MotionBuffer>(); m_aim = GetComponent <PlayerAim>(); m_launchable = GetComponent <Launchable>(); Debug.Log("BoltSkill Awoken"); }
private void Awake() { rb = this.GetComponent <Rigidbody>(); movement = this.GetComponent <PlayerMovement>(); aim = this.GetComponent <PlayerAim>(); aimUI = this.GetComponentInChildren <PlayerAimUI>(); attack = this.GetComponent <PlayerAttack>(); dash = this.GetComponent <PlayerDash>(); ability = this.GetComponent <PlayerAbility>(); input = this.gameObject.AddComponent <ControllerInput>(); Debug.Log(playerNum); input.OnAwake(playerNum); }
void Awake() { fsm = StateMachine <States> .Initialize(this, States.Init); rapidGun = GetComponent <RapidGun>(); playerAim = GetComponent <PlayerAim>(); //anim = GetComponent<Animator>(); DuckPosL = new Vector3(-0.5F, 1.5f, -2f); DuckPosR = new Vector3(0.5F, 1.5f, -2f); SwitchPos = new Vector3(0f, 2f, -4f); AimPos = new Vector3(0.75f, 1.5f, -1.5f); RunPos = new Vector3(0f, 1.5f, -1f); //switchDir = 1; }
private void Awake() { characterAimBase = GetComponent <CharacterAim_Base>(); playerAim = GetComponent <PlayerAim>(); playerBase = GetComponent <Player_Base>(); playerPunch = GetComponent <PlayerPunch>(); playerSword = GetComponent <PlayerSword>(); playerBase.enabled = false; playerPunch.enabled = false; playerSword.enabled = false; characterAimBase.OnShoot += CharacterAimBase_OnShoot; }
// Use this for initialization void Awake() { if (FindRightControllers.Instance != null) { if (FindRightControllers.Instance.PlayerSlotsToRemember[Id] != -10) { PlayerController = (PlayerIndex)FindRightControllers.Instance.PlayerSlotsToRemember[Id]; HasBeenChosen = true; } } else if (FindRightControllers.Instance != null) HasBeenChosen = false; else if (FindRightControllers.Instance == null) HasBeenChosen = true; pTran = transform; if(RendererObject != null) { if(RendererObject.GetComponent<SkinnedMeshRenderer>() != null) BodyRenderer = RendererObject.GetComponent<SkinnedMeshRenderer>(); if(RendererObject.GetComponentsInChildren<MeshRenderer>() != null) { HelmetRenderers = RendererObject.GetComponentsInChildren<MeshRenderer>(); originalHelmetColors = new Color[HelmetRenderers.Length]; for(int i=0; i<originalHelmetColors.Length; i++) { // removed by Gustav //originalHelmetColors[i] = HelmetRenderers[i].material.color; } } } switch(Id) { case 0: if (FindRightControllers.Instance == null) PlayerController = PlayerIndex.One; pMat = Materials[0]; break; case 1: if (FindRightControllers.Instance == null) PlayerController = PlayerIndex.Two; pMat = Materials[1]; break; case 2: if (FindRightControllers.Instance == null) PlayerController = PlayerIndex.Three; pMat = Materials[2]; break; case 3: if (FindRightControllers.Instance == null) PlayerController = PlayerIndex.Four; pMat = Materials[3]; break; } if(BodyRenderer != null) { BodyRenderer.material.color = pMat.color; //BodyRenderer.materials[1].color = pMat.color; PlayerColor = pMat.color; } else { renderer.material = pMat; PlayerColor = pMat.color; } spawnPoints = new GameObject[SpawnPoints.transform.GetChildCount()]; for(int i = 0; i<spawnPoints.Length; i++) { spawnPoints[i] = SpawnPoints.transform.GetChild(i).gameObject; } PlayerControllerState = GetComponent<ControllerState>(); playerAim = GetComponent<PlayerAim>(); playerMove = GetComponent<PlayerMove>(); playerJump = GetComponent<PlayerJump>(); SpawnZone = transform.Find("SpawnZone").gameObject; SpawnZone.SetActive(false); if (GetComponent<TargetIDColor>() == null) Debug.Log("ERROR - player needs to have TargetIDColor component " + gameObject); Name = gameObject.name; Points = 0; TotalMissionPlayerHasCompleted = 0; }