public override void Start() { healthBar = UIManager.I.healthBar; energyBar = UIManager.I.energyBar; attributes = GameManager.I.attributes; health = baseHealth + baseHealth * GameManager.I.costHolder.GetStatAsMultiplier(AttributeType.HEALTH); base.Start(); facingDirection = Vector2.down; if (abilityManager == null) { abilityManager = GetComponentInChildren <AbilityManager>(); } speed = normalSpeed; soundController = GetComponent <SoundController>(); path = GetComponent <Pathfinding.AIPath>(); MoveToPosition((Vector2)transform.position + Vector2.down * 3); energyBar.BuildHealtBar(maxEnergy, false); StartCoroutine(energyBar.FillAmount(energy / maxEnergy, false)); }
public virtual void Start() { //ignoreMask = (1 << LayerMask.NameToLayer("Obstacles")) | (1 << LayerMask.NameToLayer("Characters")); ignoreMask = 1 << LayerMask.NameToLayer("Characters"); colFilter.useLayerMask = true; colFilter.SetLayerMask(ignoreMask); rb = GetComponent <Rigidbody2D>(); if (vision == null) { vision = transform.Find("Vision").GetComponent <CharacterVision>(); } health = maxHealth; healthBar.BuildHealtBar(maxHealth, !(type.Equals(CharacterType.PLAYER) || type.Equals(CharacterType.BOSS))); nextAttackBG = nextAttackBar.transform.parent.gameObject; sprite = GetComponentInChildren <SpriteRenderer>(); }
protected virtual void Start() { health = maxHealth; healthBar.BuildHealtBar(maxHealth, true); }