private void Start() { uiHealthBar = HUD.GetComponentInChildren <UpdateHealthBar>(); uiHealthPercentage = HUD.GetComponentInChildren <UpdateHealthPercentage>(); uiHealthBar.SetPlayerHealthScript(gameObject.GetComponent <Health>()); uiHealthPercentage.SetPlayerHealthScript(gameObject.GetComponent <Health>()); }
void Start() { healthManager = GetComponent <HealthManager>(); healthBar = (GameObject)Instantiate(healthBarToClone, transform.position, Quaternion.identity); updateHealthBar = healthBar.GetComponent <UpdateHealthBar> (); updateHealthBar.targetToFollow = gameObject; hitDamageForLevel = hitDamage * Mathf.Pow(hitDamageLevelFactor, (float)GameLogic.GetInstance().GetCurrentLevel()); }
// Use this for initialization void Awake() { DieEffectHash = VFXController.StringToHash("Smoke"); shootTime = shootCoolDown; contactFilter2D.layerMask = hitLayerMask; rayCastPosition = transform.position; bulletPool = BulletPool.GetObjectPool(Bullet, 10); animator = GetComponent <Animator>(); shootScript = Bullet.GetComponent <StartShooting>(); spriteRenderer = GetComponent <SpriteRenderer>(); updateHealthBar = GetComponentInChildren <UpdateHealthBar>(); }
void Start() { originalPosition = transform.position; healthManager = GetComponent<HealthManager>(); healthBar = (GameObject)Instantiate(healthBarToClone, transform.position, Quaternion.identity); updateHealthBar = healthBar.GetComponent<UpdateHealthBar> (); updateHealthBar.targetToFollow = gameObject; updateHealthBar.healthBarOffset = new Vector3(0, 1f, -0.2f); seed = Random.value * 100; }
void Start() { originalPosition = transform.position; healthManager = GetComponent <HealthManager>(); healthBar = (GameObject)Instantiate(healthBarToClone, transform.position, Quaternion.identity); updateHealthBar = healthBar.GetComponent <UpdateHealthBar> (); updateHealthBar.targetToFollow = gameObject; updateHealthBar.healthBarOffset = new Vector3(0, 1f, -0.2f); seed = Random.value * 100; }
void Start() { healthManager = GetComponent<HealthManager>(); healthBar = (GameObject)Instantiate(healthBarToClone, transform.position, Quaternion.identity); updateHealthBar = healthBar.GetComponent<UpdateHealthBar> (); updateHealthBar.targetToFollow = gameObject; hitDamageForLevel = hitDamage * Mathf.Pow (hitDamageLevelFactor, (float)GameLogic.GetInstance ().GetCurrentLevel()); }