void ItemDropCollect(Collider other) { if (itemDropType == "Shield01") { PlayerShields shield = other.GetComponent <PlayerShields>(); //Debug.Log(shield); if (shield != null) { shield.AdjustShieldPower(1); } } if (itemDropType == "Turrent01") { PlayerTurrents turrent = other.GetComponent <PlayerTurrents>(); //Debug.Log(turrent); if (turrent != null) { turrent.AdjustTurrentLevel(1); } } PlayCollisionExplosion(); Destroy(gameObject); }
public void Activate_PowerUp_Shields() { _shieldActive = true; //_shieldPower = 3; // # of hits before shield is destroyed //_shield.transform.localScale = _shieldOriginalSize; // reset shield graphic to initial size _shield.SetActive(_shieldActive); // enable the Shield gameObject _playerShield = gameObject.GetComponentInChildren <PlayerShields>(); }
public void SetShield(PlayerShields shield) { this.shield = shield; switch (shield) { case PlayerShields.None: particles.normalShield.Stop(); break; case PlayerShields.Normal: particles.normalShield.Play(); break; } }
void PlayerShieldCollision(Collider other) { if ((!other.CompareTag("Bolt")) && (!other.CompareTag("Item Drop"))) { PlayerShields shield = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerShields>(); //Debug.Log(shield); if (shield != null) { shield.AdjustShieldPower(-1); } PlayCollisionExplosion(); // Destroy enemy bolts and destroy a player turrent. if (other.CompareTag("Enemy Bolt")) { PlayerTurrents turrent = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerTurrents>(); turrent.AdjustTurrentLevel(-1); Destroy(other.gameObject); } } }
// Use this for initialization void Start () { m_VectorGrid = GameObject.Find("VectorGrid").GetComponent<VectorGrid>(); playershooter = gameObject.GetComponent<Owner> ().playerowner; playershields = playershooter.GetComponent<PlayerShields> (); gameObject.particleSystem.startColor = playercolor; }