// Start is called before the first frame update void Start() { wasDead = PlayerPrefs.GetInt("wasDead") == 1; hasBuddy = PlayerPrefs.GetInt("hasBuddy") == 1; Health = PlayerPrefs.GetInt("Health"); Debug.Log("was dead: " + wasDead); Debug.Log("had buddy: " + hasBuddy); Debug.Log("Health: " + Health); gameStart = false; //assign Fey's rigid Body _fey_rigid = GetComponent <Rigidbody2D>(); //assign Fey's Sprite _fey_sprite = transform.GetChild(0).GetComponent <SpriteRenderer>(); //Get the animation script handler _fey_animation = GetComponent <Fey_Animation>(); //get fey hitbox manager No Longer Used //_feyHitBoxManager = transform.GetChild(0).GetComponent<Fey_HitBoxManager>(); //get fey light _feyLight = transform.GetChild(0).transform.GetChild(2).GetComponent <Light2D>(); _feyHealthBar = transform.GetChild(1).transform.GetChild(0).GetComponent <HealthBar>(); anim = GetComponentInChildren <Animator>(); _feyHealthBar.setMaxHP(health); if (wasDead) { Debug.Log("WAS DEAD"); anim.SetBool("wasDead", true); wasDead = false; Health = health; Debug.Log("health 2:" + Health); SavePlayer(); } else { Health = health; gameStart = true; SavePlayer(); } if (hasBuddy) { activateBuddy(); SavePlayer(); } Health = health; }
private void Start() { _fey_animation = transform.GetChild(0).GetComponent <Fey_Animation>(); }