Esempio n. 1
0
 /// <summary>
 /// Method to allow custom data initialization.
 /// </summary>
 public override void InitData()
 {
     base.InitData();
     if (bulletManager == null)
     {
         bulletManager = FindObjectOfType<BulletManager>();
     }
     SetAttackTimer();
 }
Esempio n. 2
0
 public override void InitData()
 {
     hit = false;
     render = true;
     invulerability = 0f;
     currentHealth = health;
     bulletManager = FindObjectOfType<BulletManager>();
     weapons.GetWeapons();
     camera = FindObjectOfType<Camera>();
 }
Esempio n. 3
0
 public override void InitData()
 {
     hit = false;
     render = true;
     invulerability = 0f;
     currentHealth = totalHealth;
     bulletManager = FindObjectOfType<BulletManager>();
     weapons.GetWeapons();
     camera = FindObjectOfType<Camera>();
     animator = GetComponent<Animator>();
     bodyRenderer = GetComponent<SpriteRenderer>();
     gunRenderer = transform.FindChild("Gun").GetComponent<SpriteRenderer>();
 }
Esempio n. 4
0
        /// <summary>
        /// Method to allow custom data initialization.
        /// </summary>
        public override void InitData()
        {
            base.InitData();
            if (player == null)
            {
                player = FindObjectOfType<PlayerManager>().GetPlayer().gameObject;
            }
            if (bulletManager == null)
            {
                bulletManager = FindObjectOfType<Managers.BulletManager>();
            }

            currentBullets = 0;
            shootTimer = -reloadTime;
        }
Esempio n. 5
0
 public override void InitData()
 {
     hit = false;
     render = false;
     invulerability = 0f;
     currentHealth = totalHealth;
     bulletManager = FindObjectOfType<BulletManager>();
     weapons.GetWeapons();
     camera = FindObjectOfType<Camera>();
     animator = GetComponent<Animator>();
     bodyRenderer = GetComponent<SpriteRenderer>();
     gunRenderer = transform.FindChild("Gun").GetComponent<SpriteRenderer>();
     colliderSideOffset = front.localPosition;
     height = GetComponent<BoxCollider2D>().bounds.extents.y * 2;
 }