/// <summary> /// Method to allow custom data initialization. /// </summary> public override void InitData() { base.InitData(); if (bulletManager == null) { bulletManager = FindObjectOfType<BulletManager>(); } SetAttackTimer(); }
public override void InitData() { hit = false; render = true; invulerability = 0f; currentHealth = health; bulletManager = FindObjectOfType<BulletManager>(); weapons.GetWeapons(); camera = FindObjectOfType<Camera>(); }
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>(); }
/// <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; }
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; }