void Awake() { anim = GetComponent <Animator> (); playerAudio = GetComponent <AudioSource> (); playerMovement = GetComponent <CompleteProject.PlayerMovement> (); //playerShooting = GetComponentInChildren <PlayerShooting> (); currentHealth = startingHealth; }
PlayerMovement playerMovement; // Reference to the player's movement. // Reference to the PlayerShooting script. // bool isDead; // Whether the player is dead. //bool damaged; // True when the player gets damaged. //ParticleSystem bloodParticles; void Awake() { // Setting up the references. anim = GetComponent<Animator>(); // playerAudio = GetComponent<AudioSource>(); playerMovement = GetComponent<PlayerMovement>(); // Set the initial health of the player. currentHealth = startingHealth; }
void Awake () { anim = GetComponent <Animator> (); playerAudio = GetComponent <AudioSource> (); playerMovement = GetComponent <PlayerMovement> (); playerShooting = GetComponentInChildren <PlayerShooting> (); shieldBuff = GetComponent<ShieldBuff> (); updateSlider = healthSlider.GetComponent<UpdateSlider> (); currentHealth = startingHealth; }
void Awake() { // Setting up the references. anim = GetComponent <Animator> (); playerAudio = GetComponents <AudioSource> (); playerMovement = GetComponent <PlayerMovement> (); playerShooting = GetComponentInChildren <PlayerShooting> (); // Set the initial health of the player. currentHealth = MAX_HEALTH; }
bool damaged; // True when the player gets damaged. void Awake() { // Setting up the references. anim = GetComponent <Animator>(); playerAudio = GetComponent <AudioSource>(); playerMovement = GetComponent <CompleteProject.PlayerMovement>(); playerShooting = GetComponentInChildren <Bombs_PlayerShooting>(); // Set the initial health of the player. currentHealth = startingHealth; }
void Awake() { // Setting up the references. anim = GetComponent<Animator>(); playerMovement = GetComponent<PlayerMovement>(); playerShooting = GetComponentInChildren<PlayerShooting>(); hurtAudio = FMOD_StudioSystem.instance.GetEvent("event:/sfx/player/playerHit"); // Set the initial health of the player. currentHealth = startingHealth; }
void Awake() { // Setting up the references. anim = GetComponent <Animator> (); playerAudio = GetComponent <AudioSource> (); playerMovement = GetComponent <PlayerMovement> (); playerShooting = GetComponentInChildren <PlayerShooting> (); // Set the initial health of the player. currentHealth = startingHealth; playerRigidbody = GetComponent <Rigidbody> (); }
private void OnTriggerEnter(Collider other) { if (other.gameObject.name == "Player") { CompleteProject.PlayerMovement health = other.GetComponent <CompleteProject.PlayerMovement>(); if (health != null) { health.Damage(proyectileDamage); } } Destroy(gameObject, 1f); }
private void InitializeVariablesAndReferences() { player = GameObject.FindGameObjectWithTag("Player"); enemies = GameObject.Find("Enemies"); healthPickups = GameObject.Find("HealthPickups"); ammoPickups = GameObject.Find("AmmoPickups"); bat = player.transform.Find("Bat").gameObject; ph = player.GetComponent <PlayerHealth>(); pm = player.GetComponent <CompleteProject.PlayerMovement>(); ps = player.transform.Find("GunBarrelEnd").gameObject.GetComponent <PlayerShooting>(); ShouldCalculateSequence = true; }
void Awake() { playerShooting = gunBarrellEnd.GetComponent<PlayerShooting> (); playerMovement = player.GetComponent<PlayerMovement> (); gunColor = gunBarrellEnd.GetComponent<Light> (); startLightColor = gunColor.color; lineRendererMaterial = gunBarrellEnd.GetComponent<LineRenderer> (); startLineRendererMaterial = lineRendererMaterial.material; particleSystem = gunBarrellEnd.GetComponent<ParticleSystem> (); particleSystemStartColor = particleSystem.startColor; }
// Use this for initialization void Awake() { HCI_Project.Library.Avatar avatar = new HCI_Project.Library.Avatar(); Global.Avatar = avatar; if (Global.Player != null) { Global.Player.EventManager.OnRemoteOperation += EventManager_OnRemoteOperation; } avatar.OnHP_Changed += Avatar_OnHP_Changed; avatar.OnLevelChanged += Avatar_OnLevelChanged; anim = GetComponent <Animator>(); playerMovement = GetComponent <CompleteProject.PlayerMovement>(); attackController = GetComponentInChildren <AttackController>(); StartCoroutine(Restore()); }
// Use this for initialization void Start() { this.playerHealth = this.GetComponentInChildren <CompleteProject.PlayerHealth>() as CompleteProject.PlayerHealth; this.playerMovement = this.GetComponentInChildren <CompleteProject.PlayerMovement>() as CompleteProject.PlayerMovement; this.playerShooting = this.GetComponentInChildren <CompleteProject.PlayerShooting>() as CompleteProject.PlayerShooting; }
public MoveCommand(CompleteProject.PlayerMovement _playerMovement, float _h, float _v) { this.playerMovement = _playerMovement; this.h = _h; this.v = _v; }
// Use this for initialization void Start() { this.playerHealth = this.GetComponentInChildren<CompleteProject.PlayerHealth>() as CompleteProject.PlayerHealth; this.playerMovement = this.GetComponentInChildren<CompleteProject.PlayerMovement>() as CompleteProject.PlayerMovement; this.playerShooting = this.GetComponentInChildren<CompleteProject.PlayerShooting>() as CompleteProject.PlayerShooting; }