// Use this for initialization void Start() { //the cklass with the main player animations AnimationClass = GetComponent <MainPlayerAnimations>(); var DamageBar = GameObject.FindGameObjectsWithTag("LiveBar"); //rigid body control rigid = GetComponent <Rigidbody2D>(); DamageBarAnimation = DamageBar[0]; liveBar = DamageBarAnimation.GetComponent("MainPlayerLiveBar") as MainPlayerLiveBar; }
// Use this for initialization void Start() { //the cklass with the main player animations AnimationClass = GetComponent <MainPlayerAnimations>(); backgroundPosition = DeadBG.position; var DamageBar = GameObject.FindGameObjectsWithTag("LiveBar"); //rigid body control rigid = GetComponent <Rigidbody2D>(); DamageBarAnimation = DamageBar[0]; liveBar = DamageBarAnimation.GetComponent("MainPlayerLiveBar") as MainPlayerLiveBar; // liveBar.Damage(totalDamage); }
// Use this for initialization void Start() { //we use this to flip the sprite sprite = GetComponent <SpriteRenderer>(); //the cklass with the main player animations AnimationClass = GetComponent <MainPlayerAnimations>(); //rigid body control rigid = GetComponent <Rigidbody2D>(); var DamageBar = GameObject.FindGameObjectsWithTag("LiveBar"); DamageBarAnimation = DamageBar[0]; liveBar = DamageBarAnimation.GetComponent("MainPlayerLiveBar") as MainPlayerLiveBar; player = GetComponent <Transform>(); }