// 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> (); }
// 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; }
// 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 (); }