void Start() { healthBar = FindObjectOfType <HealthBar>(); dashBar = FindObjectOfType <DashBar>(); myRigidBody = GetComponent <Rigidbody2D>(); animator = GetComponent <Animator>(); crosshair = FindObjectOfType <Crosshair>(); spriteRenderer = GetComponent <SpriteRenderer>(); levelManager = FindObjectOfType <LevelManager>(); audioManager = FindObjectOfType <AudioManager>(); //pauseMenu = FindObjectOfType<PauseMenu>(); healthBar.SetMaxHealth(maxHealth); if (PlayerPrefs.HasKey("CurrentHealth") && PlayerPrefs.GetFloat("CurrentHealth") > 0) { currentHealth = PlayerPrefs.GetFloat("CurrentHealth"); healthBar.SetHealth(currentHealth); Debug.Log("Active"); } else { currentHealth = maxHealth; } currentCharge = maxCharge; dashBar.SetCharge(maxCharge); invincible = false; }
private void Start() { dashBar = GetComponent <DashBar>(); }
// Start is called before the first frame update void Start() { aSource = GetComponent <AudioSource>(); p_rigidbody2D = GetComponent <Rigidbody2D>(); db = GetComponentInChildren <DashBar>(); }