Ejemplo n.º 1
0
	// Use this for initialization
	void Awake () {
		//print (PlayerPrefs.GetString("Difficult"));
		// --- LOAD RESOURCES TO CHARACTER ---
		//this.prefab = Resources.Load<GameObject>("Prefabs/MainCharacters/Level02/hombre_lvl2");
		this.prefab = Resources.Load<GameObject>("Prefabs/MainCharacters/Level02/"+PlayerPrefs.GetString("Player")+"_lvl2");
		this.character = Instantiate (prefab, respawn.transform.position, prefab.transform.rotation) as GameObject;
		this.cs = this.character.GetComponent<CharacterScript> ();
		this.cm = this.character.GetComponent<ClickToMove_lvl2> ();

		this.invent = this.character.GetComponentInChildren <InventoryScript> ();
		this.map = GameObject.FindGameObjectWithTag ("Minimap").GetComponent<miniMapLv2> ();
		this.music = GameObject.FindGameObjectWithTag ("music_engine").GetComponent<Music_Engine_Script> ();

		// Memory Card Save/Load data
		this.mc = GameObject.FindGameObjectWithTag ("MemoryCard").GetComponent<MemoryCard> ();
		this.save = this.mc.saveData();
		this.load = this.mc.loadData();
		time_play = this.load.loadTimePlayed ();


		// --- LOAD RESOURCES TO MENU ---
		gui = new PauseMenuGUI();
		gui.initResources ();
		
		
		this.c = this.ambientLight.light.color;

	}
	// Use this for initialization
	void Start () {
		player = GameObject.FindGameObjectWithTag ("Player");
		move_script = player.GetComponent <ClickToMove_lvl2> ();
		skill_script = player.GetComponent <Skill_Controller> ();
		action_bar = GameObject.FindGameObjectWithTag ("ActionBar").GetComponent <ActionBarScript> ();
		boss_ctrl = boss.GetComponent <Skeleton_boss_controller> ();
		fade_out = fade.GetComponent<FadeOut_lvl2> ();

		// Memory Card Save/Load data
		this.mc = GameObject.FindGameObjectWithTag ("MemoryCard").GetComponent<MemoryCard> ();
		this.save = this.mc.saveData();
		this.load = this.mc.loadData();

		boss_ctrl.teleportToRespawn ();
		boss_ctrl.rotateToPlayer (playerPos.transform.position);
		
		move_script.teleport (playerPos.transform.position);
		player.transform.position = playerPos.transform.position;
		move_script.rotateToPos (boss.transform.position);
		
		move_script.enabled = false;
		skill_script.enabled = false;
		action_bar.enabled = false;
		
		player_hand = GameObject.FindGameObjectWithTag ("PlayerHand");
		firepunch = Resources.Load <GameObject> ("Lvl2/prefabs/Fire_punch");
		finalFireball = Resources.Load <GameObject> ("Lvl2/prefabs/Final_Fireball");
		
		dialogs[0] = Resources.Load<Texture2D>("Lvl2/Dialogs/boss_dialog_6");
		dialogs[1] = Resources.Load<Texture2D>("Lvl2/Dialogs/boss_dialog_7_"+PlayerPrefs.GetString ("Player"));
		
		timer = Time.time + 1.5f;
	}
Ejemplo n.º 3
0
 public void CardRevealed(MemoryCard card)
 {
     if (_firstRevealed == null) {
         _firstRevealed = card;
     } else {
         _secondRevealed = card;
         StartCoroutine(CheckMatch());
     }
 }
Ejemplo n.º 4
0
	// Use this for initialization
	void Start () {

		// Memory Card Save/Load data
		this.mc = GameObject.FindGameObjectWithTag ("MemoryCard").GetComponent<MemoryCard> ();
		this.load = this.mc.loadData (); 

		this.backgroundTexture = Resources.Load<Texture2D>("LoadScene/background_load" + level);


	}
Ejemplo n.º 5
0
 public void cardRevealed(MemoryCard card)
 {
     if (_firstRevealed == null) {
         _firstRevealed = card;
     }
     else {
         _secondRevealed = card;
         StartCoroutine(CheckMatch());
         //Debug.Log("Match? " + (_firstRevealed.id == _secondRevealed.id));
     }
 }
Ejemplo n.º 6
0
	// Use this for initialization
	void Start () {

		// Memory Card Save/Load data
		this.mc = GameObject.FindGameObjectWithTag ("MemoryCard").GetComponent<MemoryCard> ();
		this.save = this.mc.saveData ();
		this.load = this.mc.loadData ();

		this.save.saveTimePlayed (GameEngineLevel01.getTimePlay());
		this.save.saveLevel (4);
		this.gui = new ResultsMenuGUI ();
		this.gui.initResources ();
	}
Ejemplo n.º 7
0
	// LOAD TEXTURE RESOURCES
	public void initResources () {

		this.level = PlayerPrefs.GetInt ("Level");
		// Memory Card Save/Load data
		this.mc = GameObject.FindGameObjectWithTag ("MemoryCard").GetComponent<MemoryCard> ();
		this.save = this.mc.saveData ();

		this.invent = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <InventoryScript> ();
		this.map = GameObject.FindGameObjectWithTag ("Minimap").GetComponent<miniMapLv1> ();
		this.map2 = GameObject.FindGameObjectWithTag ("Minimap").GetComponent<miniMapLv2> ();

		this.shadow = GameObject.FindGameObjectWithTag("Light");
		this.audio = GameObject.FindGameObjectWithTag("Audio");

		// MENU PAUSE
		this.backgroundTexture = Resources.Load<Texture2D>("PauseMenu/background_pause");
		
		this.continueTexture = Resources.Load<Texture2D>("PauseMenu/continue");
		this.hoverContinueTexture = Resources.Load<Texture2D>("PauseMenu/hover_continue");
		
		this.resetTexture = Resources.Load<Texture2D>("PauseMenu/reset");
		this.hoverResetTexture = Resources.Load<Texture2D>("PauseMenu/hover_reset");

		this.controlTexture = Resources.Load<Texture2D>("PauseMenu/controls");
		this.hoverControlTexture = Resources.Load<Texture2D>("PauseMenu/hover_controls");

		this.optionTexture = Resources.Load<Texture2D>("PauseMenu/option");
		this.hoverOptionTexture = Resources.Load<Texture2D>("PauseMenu/hover_option");
		
		this.exitTexture = Resources.Load<Texture2D>("PauseMenu/exit");
		this.hoverExitTexture = Resources.Load<Texture2D>("PauseMenu/hover_exit");

		// MENU KEYWORD
		this.keywordTexture = Resources.Load<Texture2D>("PauseMenu/keyword");

		// MENU CONFIRM
		this.confirmTexture = Resources.Load<Texture2D>("PauseMenu/background_confirm");

		// MENU OPTION
		this.backgroundOptionTexture = Resources.Load<Texture2D>("PauseMenu/background_opciones");
		this.checkTexture = Resources.Load<Texture2D>("PauseMenu/checked_checkbox");
		this.unCheckTexture = Resources.Load<Texture2D>("PauseMenu/unchecked_checkbox");

		this.yesTexture = Resources.Load<Texture2D>("PauseMenu/yes");
		this.hoverYesTexture = Resources.Load<Texture2D>("PauseMenu/hover_yes");
		
		this.noTexture = Resources.Load<Texture2D>("PauseMenu/no");
		this.hoverNoTexture = Resources.Load<Texture2D>("PauseMenu/hover_no");
		
		this.music = GameObject.FindGameObjectWithTag ("music_engine").GetComponent<Music_Engine_Script> ();
		
	}
Ejemplo n.º 8
0
	// Use this for initialization
	void Awake () {
		
		// ADD COMPONENT
		/*
		// Buscamos al personaje principal
		this.NPCs = GameObject.FindGameObjectsWithTag("Enemy");
		this.boss = GameObject.FindGameObjectWithTag("Boss");
*/
		this.music = GameObject.FindGameObjectWithTag ("music_engine").GetComponent<Music_Engine_Script> ();
		
		// Memory Card Save/Load data
		this.mc = GameObject.FindGameObjectWithTag ("MemoryCard").GetComponent<MemoryCard> ();
		this.save = this.mc.saveData();
		this.load = this.mc.loadData();
		
		// ADD TEXTURES
		this.LevelUpTexture = Resources.Load<Texture2D>("Misc/levelup");
	}
Ejemplo n.º 9
0
    private IEnumerator CheckMatch()
    {
        // increment score if the cards match
        if (_firstRevealed.id == _secondRevealed.id) {
            _score++;
            scoreLabel.text = "Score: " + _score;
        }

        // otherwise turn them back over after .5s pause
        else {
            yield return new WaitForSeconds(.5f);

            _firstRevealed.Unreveal();
            _secondRevealed.Unreveal();
        }

        _firstRevealed = null;
        _secondRevealed = null;
    }
Ejemplo n.º 10
0
    private IEnumerator CheckMatch()
    {
        if (_firstRevealed.id == _secondRevealed.id) {
            _score++;
            ScoreLabel.text = "Score: " + _score;
            Debug.Log ("Score: " + _score);
            if(_score == 4)
            {
                Debug.Log("Game Won!");
            }
        }
        else {
            yield return new WaitForSeconds (.5f);

            _firstRevealed.Unreveal ();
            _secondRevealed.Unreveal ();
        }

        _firstRevealed = null;
        _secondRevealed = null;
    }
Ejemplo n.º 11
0
	// Use this for initialization
	void Start () {

		// Memory Card Save/Load data
		this.mc = GameObject.FindGameObjectWithTag ("MemoryCard").GetComponent<MemoryCard> ();
		this.save = this.mc.saveData ();
		this.load = this.mc.loadData (); 

		this.trofeos = GameObject.FindGameObjectWithTag("Trofeos").GetComponent<TrophyEngine>();
		string[] list_trophies = new string[18];
		this.trofeos.getTrophys (list_trophies);

		string str = "lock_";

		// MAIN MENU
		this.backgroundTexture = Resources.Load<Texture2D>("Trofeos/background_trophyv2");
		this.PlatinoTexture = Resources.Load<Texture2D>("Trofeos/"+list_trophies[17]+"platino");
		this.EasyTexture = Resources.Load<Texture2D>("Trofeos/"+list_trophies[9]+"easy");
		this.NormalTexture = Resources.Load<Texture2D>("Trofeos/"+list_trophies[10]+"normal");
		this.HardTexture = Resources.Load<Texture2D>("Trofeos/"+list_trophies[11]+"hard");
		this.ExtremeTexture = Resources.Load<Texture2D>("Trofeos/"+list_trophies[12]+"extreme");
		this.WarriorTexture = Resources.Load<Texture2D>("Trofeos/"+list_trophies[13]+"guerrero");
		this.SageTexture = Resources.Load<Texture2D>("Trofeos/"+list_trophies[14]+"maga");
		this.ThiefTexture = Resources.Load<Texture2D>("Trofeos/"+list_trophies[15]+"ladron");
		this.AllTexture = Resources.Load<Texture2D>("Trofeos/"+list_trophies[16]+"todos");
		this.BusterSwordTexture = Resources.Load<Texture2D>("Trofeos/"+list_trophies[6]+"bustersword");
		this.Level5Texture = Resources.Load<Texture2D>("Trofeos/"+list_trophies[2]+"level5");
		this.Level10Texture = Resources.Load<Texture2D>("Trofeos/"+list_trophies[3]+"level10");
		this.Level20Texture = Resources.Load<Texture2D>("Trofeos/"+list_trophies[4]+"level20");
		this.Level50Texture = Resources.Load<Texture2D>("Trofeos/"+list_trophies[5]+"level50");
		this.miniGolemTexture = Resources.Load<Texture2D>("Trofeos/"+list_trophies[0]+"minigolem");
		this.EsqueletoTexture = Resources.Load<Texture2D>("Trofeos/"+list_trophies[7]+"esqueleto");
		this.GolemLavaTexture = Resources.Load<Texture2D>("Trofeos/"+list_trophies[1]+"golemlava");
		this.GolemHieloTexture = Resources.Load<Texture2D>("Trofeos/"+list_trophies[8]+"golemhielo");

		this.btnExitTexture = Resources.Load<Texture2D>("MainMenu/exit");
		this.hoverBtnExitTexture = Resources.Load<Texture2D>("MainMenu/hover_exit");

		this.hoverSound = GameObject.FindGameObjectWithTag("music_engine");

	}
Ejemplo n.º 12
0
	// Use this for initialization
	void Awake () {
		
		// --- LOAD RESOURCES TO CHARACTER ---
		this.prefab = Resources.Load<Transform>("Prefabs/MainCharacters/" + PlayerPrefs.GetString("Player"));
		Instantiate (prefab);
		this.character = GameObject.FindGameObjectWithTag ("Player");
		this.invent = this.character.GetComponentInChildren <InventoryScript> ();
		this.map = GameObject.FindGameObjectWithTag ("Minimap").GetComponent<miniMapLv1> ();
		this.cm = this.character.GetComponent<ClickToMove> ();
		this.cs = this.character.GetComponent<CharacterScript> ();

		// Memory Card Save/Load data
		this.mc = GameObject.FindGameObjectWithTag ("MemoryCard").GetComponent<MemoryCard> ();
		this.save = this.mc.saveData();
		this.load = this.mc.loadData();
		time_play = this.load.loadTimePlayed (); 

		this.npc_boss = GameObject.FindGameObjectWithTag("Boss");
		this.npc_enemy = GameObject.FindGameObjectsWithTag("Enemy");

		this.camera1 = GameObject.FindGameObjectWithTag ("MainCamera");
		this.camera1.SetActive (true);
		
		this.camera2 = GameObject.FindGameObjectWithTag ("CameraGoal");
		this.camera2.SetActive (false);

		this.music = GameObject.FindGameObjectWithTag ("music_engine").GetComponent<Music_Engine_Script> ();

		// --- LOAD RESOURCES TO MENU ---
		gui = new PauseMenuGUI ();
		gui.initResources ();
		
		
		this.c = this.ambientLight.light.color;
		pause = false;

	}
Ejemplo n.º 13
0
	// Use this for initialization
	void Start () {
	
		this.character = PlayerPrefs.GetString ("Player");

		this.list_inventory = new List<Item>();
		this.equip = new Item[5]; //"Weapon, Shield, Helmet, Armor, Boots"
		this.inventoryTexture = Resources.Load<Texture2D>("Inventory/Misc/inventory_" + this.character);
		this.map_lvl1 = GameObject.FindGameObjectWithTag ("Minimap").GetComponent<miniMapLv1> ();
		this.map_lvl2 = GameObject.FindGameObjectWithTag ("Minimap").GetComponent<miniMapLv2> ();
		//this.prueba = Resources.Load<Texture2D>("Inventory/Misc/slot");

		this.cs = GameObject.FindGameObjectWithTag ("Player").GetComponent<CharacterScript> ();
		this.cm = GameObject.FindGameObjectWithTag ("Player").GetComponent<ClickToMove> ();
		this.cm2 = GameObject.FindGameObjectWithTag ("Player").GetComponent<ClickToMove_lvl2> ();

		// Memory Card Save/Load data
		this.mc = GameObject.FindGameObjectWithTag ("MemoryCard").GetComponent<MemoryCard> ();
		this.save = this.mc.saveData();
		this.load = this.mc.loadData();

		// STYLES TEXT
		this.attributes_style = new GUIStyle ();
		//this.text_style.font = Resources.Load<Font>("MainMenu/avqest");
		this.attributes_style.fontStyle = FontStyle.Bold;
		this.attributes_style.normal.textColor = new Color (236f/255f,219f/255f,31f/255f);
		this.attributes_style.fontSize = 20;

		this.exp_style = new GUIStyle ();
		//this.text_style.font = Resources.Load<Font>("MainMenu/avqest");
		this.exp_style.fontStyle = FontStyle.Bold;
		this.exp_style.normal.textColor = new Color (236f/255f,219f/255f,31f/255f);
		this.exp_style.fontSize = 17;

		this.level_style = new GUIStyle ();
		//this.text_style.font = Resources.Load<Font>("MainMenu/avqest");
		this.level_style.fontStyle = FontStyle.Bold;
		this.level_style.normal.textColor = new Color (236f/255f,219f/255f,31f/255f);
		this.level_style.fontSize = 13;

		// CREATE INVENTORY
		this.resizeInventory ();
		this.createInventorySlot ();

		int num = this.load.loadNumItemsInventory ();

		if (num > 0)
			this.load.loadInventoryItems (num);

		this.equip = load.loadEquipItem ();
	}
Ejemplo n.º 14
0
	private IEnumerator CheckMatch() {
		if (_firstRevealed.id == _secondRevealed.id) {
			_score++;
		}
		else {
			yield return new WaitForSeconds(.5f);
			_firstRevealed.Unreveal(); // Закрытие несовпадающих карт.
				_secondRevealed.Unreveal();
		}
		_firstRevealed = null; // Очистка переменных вне зависимости от того, было ли совпадение.
			_secondRevealed = null;

		if (_score==10) {
		
			Restart();
		}
	}
Ejemplo n.º 15
0
	public void CardRevealed(MemoryCard card) {
		if (_firstRevealed == null) { //Сохранение карт в одной из двух переменных в зависимости от того, какая из них свободна.
			_firstRevealed = card;
		} else {
			_secondRevealed = card;
			StartCoroutine(CheckMatch()); //вызывает сопрограмму после открытия двух карт.
		}
	}
Ejemplo n.º 16
0
	// LOAD TEXTURE RESOURCES
	public void initResources () {
	
		// Memory Card Save/Load data
		this.mc = GameObject.FindGameObjectWithTag ("MemoryCard").GetComponent<MemoryCard> ();
		this.save = this.mc.saveData ();
		this.load = this.mc.loadData (); 

		// STYLES TEXT
		this.text_style = new GUIStyle ();
		this.text_style.font = Resources.Load<Font>("MainMenu/avqest");
		this.text_style.fontStyle = FontStyle.Bold;
		this.text_style.normal.textColor = new Color (42f/255f,26f/255f,16f/255f);
		this.text_style.fontSize = 24;
		//this.text_style.alignment = TextAnchor.UpperCenter ; 
		this.text_style.wordWrap = true;

		// MAIN MENU
		this.backgroundTexture = Resources.Load<Texture2D>("MainMenu/background_mainmenu");		
		this.logoTexture = Resources.Load<Texture2D>("MainMenu/logo");

		this.newGameTexture = Resources.Load<Texture2D>("MainMenu/play");
		this.hoverNewGameTexture = Resources.Load<Texture2D>("MainMenu/hover_play");

		this.loadGameTexture = Resources.Load<Texture2D>("MainMenu/load");
		this.hoverLoadGameTexture = Resources.Load<Texture2D>("MainMenu/hover_load");

		this.creditTexture = Resources.Load<Texture2D>("MainMenu/credits");
		this.hoverCreditTexture = Resources.Load<Texture2D> ("MainMenu/hover_credits");

		this.trophiesTexture = Resources.Load<Texture2D>("MainMenu/trophy");
		this.hoverTrophiesTexture = Resources.Load<Texture2D> ("MainMenu/hover_trophy");

		this.controlsTexture = Resources.Load<Texture2D>("MainMenu/controls");
		this.hoverControlsTexture = Resources.Load<Texture2D> ("MainMenu/hover_controls");
		
		this.exitGameTexture = Resources.Load<Texture2D>("MainMenu/exit");
		this.hoverExitGameTexture = Resources.Load<Texture2D>("MainMenu/hover_exit");

		// CONTROLS BACKGROUND
		this.backgroundControlsTexture = Resources.Load<Texture2D>("MainMenu/controles_menu");	

		// CHARACTER SELECTOR
		this.selectorCharacterTexture = Resources.Load<Texture2D>("MainMenu/logo_selector");	
		
		this.btnWarriorTexture = Resources.Load<Texture2D>("MainMenu/cube");
		this.hoverBtnWarriorTexture = Resources.Load<Texture2D>("MainMenu/hover_cube");
		
		this.btnSageTexture = Resources.Load<Texture2D>("MainMenu/sphere");
		this.hoverBtnSageTexture = Resources.Load<Texture2D>("MainMenu/hover_sphere");
		
		this.btnThiefTexture = Resources.Load<Texture2D>("MainMenu/triangle");
		this.hoverBtnThiefTexture = Resources.Load<Texture2D>("MainMenu/hover_triangle");

		this.btnExitTexture = Resources.Load<Texture2D>("MainMenu/exit");
		this.hoverBtnExitTexture = Resources.Load<Texture2D>("MainMenu/hover_exit");
		
		this.btnConfirmTexture = Resources.Load<Texture2D>("MainMenu/confirm");
		this.hoverBtnConfirmTexture = Resources.Load<Texture2D>("MainMenu/hover_confirm");

		this.warriorTexture = Resources.Load<Texture2D>("MainMenu/warrior");
		this.warriorAttributesTexture = Resources.Load<Texture2D>("MainMenu/attributes_warrior");

		this.sageTexture = Resources.Load<Texture2D>("MainMenu/sage");
		this.sageAttributesTexture = Resources.Load<Texture2D>("MainMenu/attributes_sage");

		this.thiefTexture = Resources.Load<Texture2D>("MainMenu/thief");
		this.thiefAttributesTexture = Resources.Load<Texture2D>("MainMenu/attributes_thief");

		// DIFFICULTY SELECTOR
		this.windowDifficultyTexture = Resources.Load<Texture2D>("MainMenu/window_difficulty");

		this.squireDifficultyTexture = Resources.Load<Texture2D>("MainMenu/escudero");
		this.hoverSquireDifficultyTexture = Resources.Load<Texture2D>("MainMenu/hover_escudero");

		this.warriorDifficultyTexture = Resources.Load<Texture2D>("MainMenu/guerrero");
		this.hoverWarriorDifficultyTexture = Resources.Load<Texture2D>("MainMenu/hover_guerrero");

		this.knightDifficultyTexture = Resources.Load<Texture2D>("MainMenu/caballero");
		this.hoverKnightDifficultyTexture = Resources.Load<Texture2D>("MainMenu/hover_caballero");

		this.paladinDifficultyTexture = Resources.Load<Texture2D>("MainMenu/paladin");
		this.hoverPaladinDifficultyTexture = Resources.Load<Texture2D>("MainMenu/hover_paladin");

		this.easyTexture = Resources.Load<Texture2D>("MainMenu/difficulty_easy");
		this.normalTexture = Resources.Load<Texture2D>("MainMenu/difficulty_normal");
		this.hardTexture = Resources.Load<Texture2D>("MainMenu/difficulty_hard");
		this.extremeTexture = Resources.Load<Texture2D>("MainMenu/difficulty_extreme");

		// DIFFICULTY SELECTOR
		this.windowNotDataTexture = Resources.Load<Texture2D>("MainMenu/window_nodata");
		if(this.load.loadPlayer() != "")
			this.windowDataGameTexture = Resources.Load<Texture2D>("MainMenu/window_data_"+this.load.loadPlayer());
		this.loadDataBtnTexture = Resources.Load<Texture2D>("MainMenu/load_data");
		this.hoverLoadDataBtnTexture = Resources.Load<Texture2D>("MainMenu/hover_load_data"); 
		this.deleteDataBtnTexture = Resources.Load<Texture2D>("MainMenu/delete_data");
		this.hoverDeleteDataBtnTexture = Resources.Load<Texture2D>("MainMenu/hover_delete_data"); 

		// MAIN CHARACTER
		this.characterTexture = this.warriorTexture;
		this.attributeTexture = this.warriorAttributesTexture;
		this.difficultyTexture = this.normalTexture;

		//Hover button music gameobject
		this.hoverSound = GameObject.FindGameObjectWithTag("music_engine");
		

	}