Esempio n. 1
0
        public void DeactiveShield()
        {
            tag = "Player";

            if (_shield != null)
            {
                Destroy(_shield.gameObject);
                _shield = null;
            }
        }
Esempio n. 2
0
		public void DeactiveShield()
		{
			tag = "Player";

			if (_shield != null)
			{
				Destroy(_shield.gameObject);
				_shield = null;
			}
		}
Esempio n. 3
0
        public void ActiveShield(float time)
        {
            if (_shield != null)
            {
                _shield.DestroyEvent -= DestroyShield;
                Destroy(_shield.gameObject);
            }

            tag = "Shield";

            _shield = Instantiate(PrefabShield);
            _shield.transform.position = Vector3.zero;
            _shield.transform.SetParent(transform, false);

            _shield.TimeLife      = time;
            _shield.DestroyEvent += DestroyShield;
        }
Esempio n. 4
0
		public void ActiveShield(float time)
		{
			if (_shield != null)
			{
				_shield.DestroyEvent -= DestroyShield;
				Destroy(_shield.gameObject);
			}

			tag = "Shield";

			_shield = Instantiate(PrefabShield);
			_shield.transform.position = Vector3.zero;
			_shield.transform.SetParent(transform, false);

			_shield.TimeLife = time;
			_shield.DestroyEvent += DestroyShield;
		}
Esempio n. 5
0
 private void DestroyShield(object sender, EventArgs e)
 {
     _shield = null;
     DeactiveShield();
 }
Esempio n. 6
0
		private void DestroyShield(object sender, EventArgs e)
		{
			_shield = null;
			DeactiveShield();
		}