Beispiel #1
0
	void Start(){
		
		this.character = GameObject.FindGameObjectWithTag ("Player");
		this.cs = this.character.GetComponent<CharacterScript_lvl2> ();
		inventory = GameObject.FindGameObjectWithTag ("Inventory").GetComponent<InventoryScript_lvl2> ();

	}
	// Use this for initialization
	void Start () {

		this.character = GameObject.FindGameObjectWithTag ("Player");
		this.cs = this.character.GetComponent<CharacterScript_lvl2> ();

		// ADD TEXTURES
		this.actionBarTexture = Resources.Load<Texture2D>("ActionBar/actionbar_v4");

		this.fireballTexture = Resources.Load<Texture2D>("ActionBar/skill_fireball");
		this.reloadFireballTexture = Resources.Load<Texture2D>("ActionBar/reload_fireball");
		this.PowerKnifeTexture = Resources.Load<Texture2D>("ActionBar/skill_powerKnife");
		this.reloadPowerKnifeTexture = Resources.Load<Texture2D>("ActionBar/reload_powerKnife");
		this.DarkAuraTexture = Resources.Load<Texture2D>("ActionBar/skill_aura");
		this.reloadDarkAuraTexture = Resources.Load<Texture2D>("ActionBar/reload_aura");

		this.attackIconTexture = Resources.Load<Texture2D>("ActionBar/icon_attack_v2");
		this.runIconTexture = Resources.Load<Texture2D>("ActionBar/icon_run");
		this.potionIconTexture = Resources.Load<Texture2D>("ActionBar/icon_potion_v2");
		this.inventoryIconTexture = Resources.Load<Texture2D>("ActionBar/icon_inventory_v2");

		//Debug.Log (this.actionBarTexture.name);

		inventory = GameObject.FindGameObjectWithTag("Inventory").GetComponent<InventoryScript_lvl2> ();

		//this.cs = GameObject.FindGameObjectWithTag ("Player").GetComponent<CharacterScript> ();

		this.text_style = new GUIStyle ();
		this.text_style.normal.textColor = Color.red;
		this.text_style.fontSize = 15;
		this.text_style.alignment = TextAnchor.UpperCenter ; 
		this.text_style.wordWrap = true; 



	}
Beispiel #3
0
	void Start(){

		
		this.character = GameObject.FindGameObjectWithTag ("Player");
		cs = this.character.GetComponent<CharacterScript_lvl2> ();

		weaponTransform = weapon.transform;
		shieldTransform = shield.transform;
 
	}
	// Use this for initialization
	void Start () {
		//
		this.fireball = Resources.Load<GameObject>("Prefabs/Character_Skills/Fireball_Skill");
		this.warrior_aura = Resources.Load<GameObject>("Prefabs/Character_Skills/Warrior_Aura1");
		this.dagger_shot = Resources.Load<GameObject>("Prefabs/Character_Skills/Daga_skill/Daga_skill");
		
		this.player = GameObject.FindGameObjectWithTag("Player");
		this.cs = this.player.GetComponent<CharacterScript_lvl2> ();
		this.cm = this.player.GetComponent<ClickToMove_lvl2> ();
		
		actual_time = Time.time;
	}
	// Use this for initialization
	void Start () {

		this.character = GameObject.FindGameObjectWithTag ("Player");
		this.cs = this.character.GetComponent<CharacterScript_lvl2> ();

		this.max_health = this.cs.getMaxHealth ();
		this.max_magic = this.cs.getMaxMagic ();

		// Resize the health and magic bar with the actual values
		this.resize_health = this.scale * Mathf.Pow(this.cs.getHealth() / this.cs.getMaxHealth (), -1);
		this.resize_magic = this.scale * Mathf.Pow(this.cs.getMagic() / this.cs.getMaxMagic (), -1);

		// Set the news actual max life and magic
		this.cs.setMaxHealth ();
		this.cs.setMaxMagic ();
		//this.max_health = this.bar_health;
		//this.max_magic = this.bar_magic;

		// ADD TEXTURES
		this.AvatarTexture = Resources.Load<Texture2D>("HealthBar/avatar_" + PlayerPrefs.GetString("Player"));
		this.HealthTexture = Resources.Load<Texture2D>("HealthBar/health");
		this.HealthBarTexture = Resources.Load<Texture2D>("HealthBar/bar_health");
		this.DamageBarTexture = Resources.Load<Texture2D>("HealthBar/damage_health");
		this.MagicTexture = Resources.Load<Texture2D>("HealthBar/magic");
		this.MagicBarTexture = Resources.Load<Texture2D>("HealthBar/bar_magic");
		this.DecotrationTextureUp = Resources.Load<Texture2D>("HealthBar/decoracion_up");
		this.DecotrationTextureDown = Resources.Load<Texture2D>("HealthBar/decoracion_down");

		// ADD MATERIALS
		this.HealthBarMaterial = Resources.Load<Material>("HealthBar/Materials/bar_health");
		this.DamageBarMaterial = Resources.Load<Material>("HealthBar/Materials/damage_health");
		this.MagicBarMaterial = Resources.Load<Material>("HealthBar/Materials/bar_magic");

		this.health = 0f;
		this.HealthBarMaterial.SetFloat("_Cutoff", this.health);

		this.damage = 0f;
		this.DamageBarMaterial.SetFloat("_Cutoff", this.damage);

		this.magic = 0f;
		this.MagicBarMaterial.SetFloat("_Cutoff", this.magic);
	
	}