// Use this for initialization void Start () { name = npc.tag.Substring (0, npc.tag.Length - 1); //this.npc = GameObject.FindGameObjectWithTag ("Enemy"); if (name == "Skeleton") { this.skel = this.npc.GetComponent<Skeleton_controller_2> (); this.resize_health = Mathf.Pow(this.skel.actual_health / this.skel.health, -1); } else if (name == "FireDemon" || name == "IceDemon" || name == "MiniIceDemon") { this.demon = this.npc.GetComponent<FireDemon_Controller> (); this.resize_health = Mathf.Pow(this.demon.actual_health / this.demon.health, -1); } else if(this.npc.tag == "IceGolem"){ this.golem = this.npc.GetComponent<Ice_Golem_controller> (); this.resize_health = Mathf.Pow(this.golem.actual_health / this.golem.health, -1); } else if(this.npc.tag == "Boss"){ this.boss = this.npc.GetComponent<Skeleton_boss_controller> (); this.resize_health = Mathf.Pow(this.boss.health / this.boss.total_health, -1); } // ADD TEXTURES this.HealthTexture = Resources.Load<Texture2D>("NPC/NPCbar_health"); this.HealthBarTexture = Resources.Load<Texture2D>("NPC/NPCbar"); this.health = 0f; }
// Use this for initialization void Start () { stage = GameObject.FindGameObjectWithTag ("GameController").GetComponent<StageController> (); stage.deactive_Stage (3); player = GameObject.FindGameObjectWithTag ("Player"); music = GameObject.FindGameObjectWithTag ("music_engine").GetComponent<Music_Engine_Script> (); demon_anim = demon.GetComponent<FireDemon_Controller> (); move_script = player.GetComponent <ClickToMove_lvl2> (); skill_script = player.GetComponent <Skill_Controller> (); move_script.enabled = false; skill_script.enabled = false; }