示例#1
0
 /// <summary>
 /// Method to allow custom data initialization.
 /// </summary>
 public override void InitData()
 {
     base.InitData();
     if (bulletManager == null)
     {
         bulletManager = FindObjectOfType<BulletManager>();
     }
     SetAttackTimer();
 }
示例#2
0
文件: Player.cs 项目: echen67/Nullptr
 public override void InitData()
 {
     hit = false;
     render = true;
     invulerability = 0f;
     currentHealth = health;
     bulletManager = FindObjectOfType<BulletManager>();
     weapons.GetWeapons();
     camera = FindObjectOfType<Camera>();
 }
示例#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>();
 }
示例#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;
        }
示例#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;
 }