void Awake () { // Setting up references. playerControl = GetComponent<playerC>(); player = GameObject.Find("Player"); healthBar = GameObject.Find("HP").GetComponent<SpriteRenderer>(); HpEffect = GameObject.Find("HpEffect").GetComponent<SpriteRenderer>(); scene = GameObject.FindWithTag ("GameScene"); hp = MaxHp; oldHp = hp; anim = GetComponent<Animator>(); // Getting the intial scale of the healthbar (whilst the player has full health). healthScale = healthBar.transform.localScale; HpEffectScale = HpEffect.transform.localScale; }
//private bool wallJumped; void Awake(){ //player = gameObject.GetComponent<playerC>(); playerSc = player.GetComponent<playerC> (); //player = GameObject.Find ("Player").GetComponent<playerC> (); }
void Awake(){ playerControl = GameObject.FindGameObjectWithTag ("Player").GetComponent<playerC> (); }
void Awake() { faceW = GetComponent<playerC>(); }