void Start() { activeShield = false; shield.SetActive(false); powerupManager = FindObjectOfType <PowerupManager>(); playerHealth = FindObjectOfType <HealthPlayer>(); }
private void Awake() { rb2d = GetComponent <Rigidbody2D>(); waveSpawner = GetComponent <WaveSpawner>(); anim = GetComponent <Animator>(); healthPlayer = GetComponent <HealthPlayer>(); }
private void Start() { healthPlayer = GetComponent <HealthPlayer>(); Player.Singleton.TakeHeatPointEvent += TakeHp; Player.Singleton.DeathEvent += Fill; }
void MakeInstance() { if (instane == null) { instane = this; } }
void SetCargerFalse(Collider2D col) { countCargerAgain = 0; countStartFollow = 0; carger = false; dir = Vector2.zero; toGo = Vector2.zero; anim.SetBool("Carger", carger); firstTime = false; if (col.CompareTag("Player")) { HealthPlayer healthPlayer = col.GetComponent <HealthPlayer>(); healthPlayer.Damage(damage); GetComponent <AudioManagerEnemies>().PlayAudiosAttack(); carger = false; if (healthPlayer.IsDead()) { StartCoroutine(ResetPos()); } } else { if (!hasFlipped) { Flip(); hasFlipped = true; } } }
// Use this for initialization void Start() { zombieBody = GetComponent <Rigidbody2D> (); zombieRenderer = GetComponent <SpriteRenderer> (); animator = GetComponent <Animator> (); health = GameObject.Find("Player").GetComponent <HealthPlayer> (); }
UnityEngine.AI.NavMeshAgent nav; // Reference to the nav mesh agent. void Awake() { // Set up the references. player = GameObject.FindGameObjectWithTag("Player").transform; playerHealth = player.GetComponent <HealthPlayer> (); enemyHealth = GetComponent <EnemyHealth> (); nav = GetComponent <UnityEngine.AI.NavMeshAgent> (); }
float timer; // Timer for counting up to the next attack. void Awake() { // Setting up the references. player = GameObject.FindGameObjectWithTag("Player"); playerHealth = player.GetComponent <HealthPlayer> (); enemyHealth = GetComponent <EnemyHealth>(); anim = GetComponent <Animator> (); }
void Start() { vidas = GetComponent <HealthPlayer>(); if (respawn) { Spawn(); } }
void Start() { health = GameObject.FindObjectOfType <HealthPlayer>(); //GameObject h = GameObject.FindGameObjectWithTag("Grandma"); //Debug.Log(h.name); //health = h.GetComponent<HealthPlayer>(); Debug.Log("Health: " + health.maxHealth); }
private void Start() { player = GameObject.Find("Player"); playerHealth = player.GetComponent <HealthPlayer>(); playerMovements = player.GetComponent <Movements>(); sprite = GetComponent <SpriteRenderer>(); }
void Start() { animator = GetComponent <Animator>(); playerCaracteristics = GetComponent <PlayerCaracteristics>(); playerAbilities = GetComponent <PlayerAbilitiesBis>(); healthPlayerScript = GetComponent <HealthPlayer>(); }
private void OnTriggerEnter2D(Collider2D other) { Destroy(this.gameObject, 0); HealthPlayer player = other.GetComponent <HealthPlayer>(); //Si colisiona con el jugador if (player != null) { player.LoseHearts(damage); } }
// public GameObject player; void Awake() { // health = player.GetComponent<HealthPlayer>(); GameObject player = GameObject.FindGameObjectWithTag("Player"); if (player) { health = player.GetComponent <HealthPlayer>(); } gameManager = GameObject.Find("GamePlayManager"); }
private void Start() { player = GameObject.Find("Player"); playerHealth = player.GetComponent <HealthPlayer>(); enemyHealthBar = Instantiate(enemyHealthBarPrefab, new Vector2(transform.position.x, transform.position.y + 1), Quaternion.identity); enemyHealthBar.transform.parent = transform; enemyHealthScript = enemyHealthBar.GetComponent <EnemyHealthBar>(); }
void Awake() { // Set up the references. player = GameObject.FindGameObjectWithTag("Player").transform; enemyMask = LayerMask.GetMask("Shootable"); playerHealth = player.GetComponent <HealthPlayer> (); enemyHealth = GetComponent <EnemyHealth> (); nav = GetComponent <NavMeshAgent> (); enemyHealth = GetComponent <EnemyHealth> (); anim = GetComponent <Animator> (); resetEnemyStats = GetComponent <EnemyResetStats> (); }
void Awake() { inputState = GetComponent <InputState> (); runBehaviour = GetComponent <Run> (); jumpBehaviour = GetComponent <Jump> (); animator = GetComponent <Animator> (); collisionState = GetComponent <CollisionState> (); duckBehaviour = GetComponent <Duck> (); attackBehaviour = GetComponent <Attack> (); knockbackBehaviour = GetComponent <Knockback> (); equipBehaviour = GetComponent <Equip> (); health = GetComponent <HealthPlayer> (); }
private void OnEnable() { healthPlayer = GetComponent <HealthPlayer>(); Debug.Log("vidas restantes " + healthPlayer.LivesRemaining()); Debug.Log(healthPlayer.maxHealth); for (int i = 0; i < lives; i++) { if (healthPlayer.LivesRemaining() < healthPlayer.maxHealth) { healthPlayer.AddLife(); } } Debug.Log("vidas tras curarte" + healthPlayer.LivesRemaining()); DisableSandwich(); }
public void NoDamageShield(BulletType type) { if (data.baseStats.bulletType[currentType].Equals(type)) { Debug.Log("No Damage"); HealthPlayer player = FindObjectOfType <HealthPlayer>(); player.Damage(0); } else { Debug.Log("Damage"); HealthPlayer player = FindObjectOfType <HealthPlayer>(); Bullet bullet = FindObjectOfType <Bullet>(); player.Damage(bullet.damage); } }
private void Awake() { // вызываю при респавне объекта scriptCountKills = GameObject.Find("Scripts"); if (gameObject.name == "player") { base.textNameItem = "Buy Health Point(+100)"; if (base.ExistWord()) { hp += 100; HealthPlayer healthPlayerText = gameObject.GetComponent <HealthPlayer>(); healthPlayerText.SubtractionHP(0, 200); } } }
private void Start() { enemiesTransform = groupEnemies.GetComponent <Transform>(); playerHealth = player.GetComponent <HealthPlayer>(); GameObject enemy1 = Instantiate(enemy1Prefab); GameObject enemy2 = Instantiate(enemy2Prefab); enemy1.transform.parent = enemiesTransform; enemy2.transform.parent = enemiesTransform; playerHealthOne = GameObject.Find("SEG1"); playerHealthTwo = GameObject.Find("SEG2"); playerHealthThree = GameObject.Find("SEG3"); playerHealthFour = GameObject.Find("SEG4"); playerHealthFive = GameObject.Find("SEG5"); }
private void OnCollisionStay2D(Collision2D collision) { shield = GetComponentInChildren <Shield>(); Debug.Log("collision stay"); HealthPlayer player = collision.collider.GetComponent <HealthPlayer>(); if (swat != null) { if (shield != null && player != null) { player.LoseHearts(damage); } else if (shield == null && player != null) { player.LoseHearts(damage); } } }
void Awake() { moveHorizontal = true; myBody = GetComponent <Rigidbody2D>(); m_PhotonView = GetComponent <PhotonView>(); if (defaultbulletConfig == null) { Debug.LogWarning("MovementComponent, misisng default config !!"); enabled = false;//deactive } else { activeBulletConfig = defaultbulletConfig; } healthPlayer = GetComponent <HealthPlayer>(); }
void Awake() { Destroy(gameObject, DestroyTime); MakeInstance(); spriteItem = GetComponent <SpriteRenderer>(); boxItem = GetComponent <BoxCollider2D>(); Player = GameObject.FindGameObjectWithTag("Player").GetComponent <HealthPlayer>(); isMusic = PlayerPrefs.GetString("Music"); if (isMusic == "Off") { audioSource.mute = true; } else { audioSource.mute = false; } }
private void OnTriggerStay2D(Collider2D collision) { HealthPlayer player = collision.GetComponent <HealthPlayer>(); if (preso != null) { if (player != null) { animator.SetBool("Atizando", true); player.LoseHearts(damage); } } else { //Si colisiona con el jugador if (player != null) { player.LoseHearts(damage); } } }
private void SetDamages(int p_Damages) { Collider[] l_HitCollider = Physics.OverlapSphere(transform.position, m_Radius, m_Layer); foreach (var item in l_HitCollider) { if (item.GetComponent <Enemy>() != null) { m_Enemy = item.GetComponent <Enemy>(); m_Enemy.TakeDamages(p_Damages); Destroy(gameObject); } if (item.GetComponent <HealthPlayer>() != null) { m_PlayerLife = item.GetComponent <HealthPlayer>(); m_PlayerLife.TakesDamages(p_Damages); Destroy(gameObject); } Debug.Log("j'ai touché : " + item.gameObject.name); } }
void OnTriggerEnter2D(Collider2D triggerCollider) { if (triggerCollider.tag == "Grandma") { SoundManager.PlaySound("punch"); Destroy(gameObject); } if (triggerCollider.tag == "Umbrella") { SoundManager.PlaySound("ding"); HealthPlayer hp = FindObjectOfType <HealthPlayer>(); Debug.Log("cp1"); int i = hp.positions.FindIndex(gp => gp.position.position.Equals(triggerCollider.gameObject.transform.position)); Debug.Log(i); hp.positions[i] = new GrandmaPositions(hp.positions[i].position, false); Debug.Log("cp2"); score.Cash.Value += 20; Destroy(triggerCollider.gameObject); Destroy(gameObject); } }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("Enemy")) { Debug.Log("Enemigo"); Enemy enemy = other.GetComponent <Enemy>(); if (enemy != null) { Debug.Log("Buuu"); enemy.Damage(damage); Destroy(this.gameObject); } } if (other.CompareTag("Player")) { HealthPlayer player = other.GetComponent <HealthPlayer>(); if (player != null) { player.Damage(damage); Destroy(this.gameObject); } } if (other.CompareTag("EnemyBullet")) { Destroy(other.gameObject); Destroy(this.gameObject); } else { Destroy(this.gameObject, 1f); } }
// Use this for initialization void Start() { terserah = GameObject.Find("HeadCollider"); script = (PlayerHealth)terserah.GetComponent(typeof(PlayerHealth)); script2 = (HealthPlayer)terserah.GetComponent(typeof(HealthPlayer)); }
// Use this for initialization void Start() { Player = GameObject.FindGameObjectWithTag ("Player"); playerHealth = Player.GetComponent <HealthPlayer> (); }
void Start() { bigGhostRenderer = GetComponent <SpriteRenderer> (); health = GameObject.Find("Player").GetComponent <HealthPlayer> (); spawner = GameObject.Find("Spawner").GetComponent <Spawner> (); }