void Awake() { capsuleCollider = GetComponent <CapsuleCollider> (); currentHealth = startingHealth; healthBar = GetComponentInChildren <EnemyHealthBarController>(); }
// Start is called before the first frame update void Start() { AdjustStartPosition(); healthBarController = GetComponent <EnemyHealthBarController>(); playerController = GameObject.FindObjectOfType <PlayerController>(); health = maxHealth; }
protected virtual void Awake() { Stats = new Attributes(); PickupItemPrefab = Resources.Load <PickupItem>("Prefabs/Interactable/Pickup Item"); Player = GameObject.FindGameObjectWithTag("Player").GetComponent <Player>(); EnemyMovement = GetComponentInChildren <EnemyMovement>(); HealthBar = EnemyHealthBarController.CreateHealthBar(transform); Animator = GetComponent <Animator>(); Stats.CurrentHealth = Stats.MaxHealth; Stats.CurrentMana = Stats.MaxMana; Rigidbody2D = GetComponentInParent <Rigidbody2D>(); }
void Awake() { InIntro = true; if (Instance != null && Instance != this) { Destroy(gameObject); } else { Instance = this; } canvas = GameObject.FindGameObjectWithTag("Canvas"); characterPanel = canvas.transform.Find("Panel_Character").gameObject; //StartCoroutine(ScreenFader.FadeToClear()); player = GameObject.FindGameObjectWithTag("Player").GetComponent <Player>(); Camera.main.transform.position = player.transform.position; GameVersion = "Development V10.0"; FloatingTextController.Initialize(); EnemyHealthBarController.Initialize(); }