private void Awake() { ui = FindObjectOfType <PlayerUI>(); player = FindObjectOfType <Player>(); database = FindObjectOfType <QuestDatabase>(); dialogText_0 = "Bonjour je suis un PNJ"; }
void Awake() { database = QuestDatabase.Instance(questJSON); qlogmodel = GetComponent <QuestLogModel>(); qlogview = GetComponent <QuestLogView>(); qprogress = GameObject.Find("Data").GetComponentInChildren <QuestProgress>(); }
} //クエスト名をキーとし,クリア済みクエストを値とする辞書 public static void Init(Transform headerParent, DS.UI.Tab tab) //QuestManagerBehaviorのStartで呼び出される { questTab = tab; OrderedQuest = new Dictionary <string, Quest_Behaviour>(); ClearedQuest = new Dictionary <string, Quest_Behaviour>(); database = new QuestDatabase(); }
public static List <Quest> GenerateQuests(Campaign campaign, int seed = 0) { if (seed != 0) { Random.InitState(seed); } QuestDatabase questData = DarkestDungeonManager.Data.QuestDatabase; QuestGenerationData genData = questData.QuestGeneration; QuestGenerationInfo questGenerationInfo = GetQuestInfo(genData, campaign); DistributeQuests(questGenerationInfo, genData, campaign); DistributeQuestTypes(questGenerationInfo, questData); DistributeQuestGoals(questGenerationInfo, questData); DistributeQuestRewards(questGenerationInfo, questData); List <Quest> generatedQuests = new List <Quest>(); foreach (var info in questGenerationInfo.dungeonQuests) { foreach (var quest in info.Quests) { generatedQuests.Add(quest); } } return(generatedQuests); }
// Use this for initialization void Start() { inv = GameObject.Find("ItemDatabase").GetComponent <Inventory>(); qd = inv.GetComponent <QuestDatabase>(); database = inv.GetComponent <ItemDatabase>(); player = GetComponent <Player> (); if (LoadData.instance.dataLoaded) { Load(); UpdateGold(0); } else { UpdateGold(100); for (int i = 0; i < 10; i++) { equippedItems.Add(new Item()); } } UpdateFocus(0); UpdateHealth(); UpdateGearStats(); player.UpdateExperience(); }
public void Load() { if (!IsLoaded) { bool isNewSave = false; PlayerCharacterObject playerCharacter = GetComponent <PlayerCharacterObject>(); GameApplication application = nebulaObject.mmoWorld().application; QuestSave questSave = QuestDatabase.instance(application).LoadQuests(playerCharacter.characterId, out isNewSave); completedQuests.Clear(); foreach (string cQuest in questSave.CompletedQuests) { completedQuests.Add(cQuest); } startedQuests.Clear(); foreach (Hashtable sQuest in questSave.StartedQuests) { QuestInfo questInfo = new QuestInfo(this); questInfo.ParseInfo(sQuest); if (questInfo.IsValid) { startedQuests.Add(questInfo); } } questVariables.Clear(); foreach (DictionaryEntry entry in questSave.QuestVariables) { questVariables.TryAdd(entry.Key.ToString(), entry.Value); } IsLoaded = true; } }
public void Init() { this.detailView.gameObject.SetActive(false); // 이전에 있던 Element 반환 for (int i = 0; i < this.elements.Length; i++) { ObjectPoolManager.inst.Return(this.elements[i].gameObject); } // 현재 진행중인 퀘스트정보를 받아 리스트로 보여줌 this.elements = new QuestUI_QuestElement[QuestManager.inst.progessingQuest.Count]; for (int i = 0; i < QuestManager.inst.progessingQuest.Count; i++) { this.elements[i] = ObjectPoolManager.inst.Get <QuestUI_QuestElement>(PrefabPath.UI.QuestUI_QuestElement); this.elements[i].transform.SetParent(this.scrollRect.content, false); (this.elements[i].transform as RectTransform).anchoredPosition3D = Vector3.zero; this.elements[i].transform.localRotation = Quaternion.identity; this.elements[i].transform.localScale = Vector3.one; this.elements[i].Init( this, QuestManager.inst.progessingQuest[i].key, QuestDatabase.GetInfo(QuestManager.inst.progessingQuest[i].key).title); } }
// Start is called before the first frame update void Start() { instance = this; saveQuestResources(); loadQuestResources(); }
public void AddItem(int itemType) { ItemType i = (ItemType)itemType; switch (i) { case ItemType.Weapon: if (WeaponDatabase.Instance.Count >= 0) { int rand = Mathf.FloorToInt(UnityEngine.Random.Range(0, (WeaponDatabase.Instance.Count))); IM.Add <Weapon>(WeaponDatabase.GetItemFromAsset(WeaponDatabase.Instance.GetAtIndex(rand))); } break; case ItemType.Consumable: if (ConsumableDatabase.Instance.Count >= 0) { int rand = Mathf.FloorToInt(UnityEngine.Random.Range(0, (QuestDatabase.Instance.Count))); IM.Add <Consumable>(ConsumableDatabase.GetItemFromAsset(ConsumableDatabase.Instance.GetAtIndex(rand))); } break; case ItemType.Quest: if (QuestDatabase.Instance.Count >= 0) { int rand = Mathf.FloorToInt(UnityEngine.Random.Range(0, (QuestDatabase.Instance.Count - 1))); IM.Add <QuestItem>(QuestDatabase.GetItemFromAsset(QuestDatabase.Instance.GetAtIndex(rand))); } break; } }
void OnEnable() { if (!AssetDatabase.IsValidFolder(questPath)) { AssetDatabase.CreateFolder("Assets/Databases", "Quests"); } if (EditorPrefs.HasKey(editorPref)) { string path = EditorPrefs.GetString(editorPref); questDatabase = AssetDatabase.LoadAssetAtPath(path, typeof(QuestDatabase)) as QuestDatabase; } if (!EditorPrefs.HasKey("NextID")) { EditorPrefs.SetInt("NextID", 1); } // Fill the popup list: Type[] types = Assembly.GetAssembly(typeof(QuestObjective)).GetTypes(); quesObjectiveNames = (from Type type in types where type.IsSubclassOf(typeof(QuestObjective)) select type.FullName).ToArray(); }
private static void InitDb(uint serverId) { var server = BasicTeraData.Instance.Servers.GetServer(serverId); Region = server.Region; var td = new TeraData(Region); var lang = td.GetLanguage(Region); //if (TimeManager.Instance.CurrentRegion != Region) //{ TimeManager.Instance.SetServerTimeZone(lang); SettingsManager.LastRegion = lang; //} TimeManager.Instance.SetGuildBamTime(false); EntitiesManager.CurrentDatabase = new MonsterDatabase(lang); ItemsDatabase.Reload(lang); AbnormalityManager.CurrentDb = new AbnormalityDatabase(lang); SocialDatabase.Load(); SystemMessages.Load(); GuildQuestDatabase.Load(); AccountBenefitDatabase.Load(); AchievementDatabase.Load(); AchievementGradeDatabase.Load(); MapDatabase.Load(); QuestDatabase.Load(); }
protected void Start() { board = GameObject.Find("GameManager").GetComponent <BoardManager>(); inventory = GameObject.Find("ItemDatabase").GetComponent <Inventory>(); animator = GetComponent <Animator>(); player = GameObject.FindGameObjectWithTag("Player").transform; qd = inventory.gameObject.GetComponent <QuestDatabase>(); }
// Start is called before the first frame update void Start() { qd = GetComponent <QuestDatabase>(); pi = GameObject.Find("PlayerInfo").GetComponent <PlayerInfo>(); mqs = GameObject.Find("PlayerInfo").GetComponent <MyQuestSaver>(); mqs.leftAdventure = false; UpdateList(); }
void CloseDatabase() { questDatabase = null; if (EditorPrefs.HasKey(editorPref)) { EditorPrefs.DeleteKey(editorPref); } }
private static void DistributeQuestRewards(QuestGenerationInfo questInfo, QuestDatabase questData) { var trinketList = DarkestDungeonManager.Data.Items["trinket"].Values.Cast <Trinket>().ToList(); foreach (var dungeonInfo in questInfo.DungeonQuests) { foreach (var quest in dungeonInfo.Quests) { if (quest.IsPlotQuest) { var plotQuest = (PlotQuest)quest; if (plotQuest.PlotTrinket != null) { var rarityTrinketList = trinketList.FindAll(item => item.RarityId == plotQuest.PlotTrinket.Rarity); ItemDefinition trinket = new ItemDefinition(); trinket.Type = "trinket"; trinket.Amount = 1; trinket.Id = rarityTrinketList[Random.Range(0, rarityTrinketList.Count)].Id; plotQuest.Reward.ItemDefinitions.Add(trinket); } continue; } CompletionReward reward = new CompletionReward(); quest.Reward = reward; reward.ResolveXP = questData.QuestGeneration.ResolveXpReward[quest.Difficulty][quest.Length]; ItemDefinition heirloomOne = new ItemDefinition(); ItemDefinition heirloomTwo = new ItemDefinition(); heirloomOne.Type = "heirloom"; heirloomOne.Id = questData.QuestGeneration.HeirloomTypes[quest.Dungeon][0]; heirloomOne.Amount = questData.QuestGeneration.HeirloomAmounts[heirloomOne.Id][quest.Difficulty][quest.Length]; reward.ItemDefinitions.Add(heirloomOne); heirloomTwo.Type = "heirloom"; heirloomTwo.Id = questData.QuestGeneration.HeirloomTypes[quest.Dungeon][1]; heirloomTwo.Amount = questData.QuestGeneration.HeirloomAmounts[heirloomOne.Id][quest.Difficulty][quest.Length]; reward.ItemDefinitions.Add(heirloomTwo); reward.ItemDefinitions.Add(questData.QuestGeneration.ItemTable[quest.Difficulty][quest.Length][0]); foreach (var trinketInfo in questData.QuestGeneration.TrinketChances) { if (trinketInfo.Value[quest.Difficulty][quest.Length] != 1) { continue; } var rarityTrinketList = trinketList.FindAll(item => item.RarityId == trinketInfo.Key); ItemDefinition trinket = new ItemDefinition(); trinket.Type = "trinket"; trinket.Amount = 1; trinket.Id = rarityTrinketList[Random.Range(0, rarityTrinketList.Count)].Id; reward.ItemDefinitions.Add(trinket); break; } } } }
public void OpenBox() { this.gameObject.SetActive(true); qd = GetComponent <QuestDatabase>(); pi = GameObject.Find("PlayerInfo").GetComponent <PlayerInfo>(); mqs = GameObject.Find("PlayerInfo").GetComponent <MyQuestSaver>(); mqs.leftAdventure = false; UpdateList(); }
void LoadAuxillaryDatabases() { // ITEM database _itemDatabase = AssetDatabase.LoadAssetAtPath <ItemDatabase>(itemPath); _itemDatabase.ReloadDatabase(); // ITEM database _questDatabase = AssetDatabase.LoadAssetAtPath <QuestDatabase>(questPath); _questDatabase.ReloadDatabase(); }
void CreateQuestDatabase() { Debug.Log("Creating Quest database..."); questDatabase = ScriptableObject.CreateInstance <QuestDatabase>(); Debug.Log(questDatabase); AssetDatabase.CreateAsset(questDatabase, "Assets/questdb.asset"); AssetDatabase.SaveAssets(); EditorUtility.FocusProjectWindow(); Selection.activeObject = questDatabase; }
// Use this for initialization void Start() { for(int i = 0; i < slotsNo; i++) { slots.Add (new Quest()); questLog.Add(new Quest()); } questDatabase = GameObject.FindGameObjectWithTag("Quest Database").GetComponent<QuestDatabase>(); AddQuest (0); AddQuest (1); AddQuest (2); }
void LoadQuestDatabase() { questDatabase = AssetDatabase.LoadAssetAtPath <QuestDatabase>(QuestAssetPath); if (questDatabase == null) { CreateQuestDatabase(); } else { EditorUtility.FocusProjectWindow(); Selection.activeObject = questDatabase; } }
QuestDatabase NewDatabase() { Debug.Log("New Quest Database"); QuestDatabase asset = ScriptableObject.CreateInstance <QuestDatabase>(); string path = "Assets/Databases/" + editorPref + ".asset"; AssetDatabase.CreateAsset(asset, path); asset.Quests = new List <Quest>(); AssetDatabase.SaveAssets(); EditorPrefs.SetString(editorPref, path); return(asset); }
private QuestDatabase(TextAsset questDatabaseJson) { questDatabaseInstance = JsonUtility.FromJson <QuestDatabase>(questDatabaseJson.text); questDatabaseInstance.questDatabaseIndexed = new Dictionary <int, Quest>(); foreach (Quest quest in questDatabaseInstance.questDatabase) { foreach (string s in quest.objectives.Split(',')) { int x = 0; int.TryParse(s, out x); quest.ObjectiveList.Add(x); } foreach (string s in quest.objectiveQuantity.Split(',')) { int x = 0; int.TryParse(s, out x); quest.ObjectiveQuantityList.Add(x); } foreach (string s in quest.reward.Split(',')) { int x = 0; int.TryParse(s, out x); quest.RewardList.Add(x); } foreach (string s in quest.rewardQuantity.Split(',')) { int x = 0; int.TryParse(s, out x); quest.RewardQuantityList.Add(x); } foreach (string s in quest.subQuests.Split(',')) { int x = 0; int.TryParse(s, out x); quest.SubQuestsList.Add(x); } foreach (string s in quest.requiredQuests.Split(',')) { int x = 0; int.TryParse(s, out x); if (x != 0) { quest.RequiredQuestList.Add(x); } } questDatabaseInstance.questDatabaseIndexed.Add(quest.ID, quest); } }
static void DistributeQuestTypes(QuestGenerationInfo questInfo, QuestDatabase questData) { foreach (var dungeonInfo in questInfo.dungeonQuests) { foreach (var quest in dungeonInfo.Quests) { if (quest.IsPlotQuest) { continue; } GeneratedQuestType questType = RandomSolver.ChooseByRandom(dungeonInfo.GeneratedTypes); quest.Type = questType.Type; quest.Length = questType.Length; } } }
public void Init(string key) { this.questInfo = QuestDatabase.GetInfo(key); // 제목 텍스트 갱신 this.titleText.text = this.questInfo.title; // 컨텐츠 텍스트 갱신 string content = this.questInfo.content + "\n\n"; for (int i = 0; i < this.questInfo.ifText.Length; i++) { int progress = QuestManager.inst.GetProgress(this.questInfo.questKey, this.questInfo.requestKey[i]); content += string.Format("{0} <color={1}>[{2} / {3}]</color>\n", this.questInfo.ifText[i], this.questInfo.request[i] <= progress ? Defines.TRUE_COLOR_CODE : Defines.FALSE_COLOR_CODE, Mathf.Min(progress, this.questInfo.request[i]), this.questInfo.request[i]); } this.contentText.text = content; // 보상 UI 처리 for (int i = 0; i < this.elements.Length; i++) { ObjectPoolManager.inst.Return(this.elements[i].gameObject); // 기존 Element제거 } this.elements = new QuestDetailView_RewardElement[this.questInfo.rewardKey.Length]; for (int i = 0; i < this.questInfo.rewardKey.Length; i++) { this.elements[i] = ObjectPoolManager.inst.Get <QuestDetailView_RewardElement>(PrefabPath.UI.QuestDetailView_RewardElement); this.elements[i].transform.SetParent(this.rewardLayout, false); (this.elements[i].transform as RectTransform).anchoredPosition3D = Vector3.zero; this.elements[i].transform.localRotation = Quaternion.identity; this.elements[i].transform.localScale = Vector3.one; this.elements[i].Init(this.questInfo.rewardKey[i], this.questInfo.reward[i]); } // 퀵뷰버튼 처리 UpdateQuickViewText(); }
void OpenDatabase() { string absPath = EditorUtility.OpenFilePanel("Select Database", "", ""); Debug.Log(absPath); if (absPath.StartsWith(Application.dataPath)) { string relPath = absPath.Substring(Application.dataPath.Length - "Assets".Length); questDatabase = AssetDatabase.LoadAssetAtPath(relPath, typeof(QuestDatabase)) as QuestDatabase; if (questDatabase.Quests == null) { questDatabase.Quests = new List <Quest>(); EditorUtility.SetDirty(questDatabase); } if (questDatabase) { Debug.Log(relPath); EditorPrefs.SetString(editorPref, relPath); } } }
static void DistributeQuestGoals(QuestGenerationInfo questInfo, QuestDatabase questData) { List <string> availableGoals = new List <string>(); foreach (var dungeonInfo in questInfo.dungeonQuests) { foreach (var quest in dungeonInfo.Quests) { if (quest.IsPlotQuest) { continue; } QuestType questType = questData.QuestTypes[quest.Type]; foreach (var goalList in questType.GoalLists) { if (goalList.Dungeon == "all") { availableGoals.AddRange(goalList.Goals); } else if (goalList.Dungeon == quest.Dungeon) { availableGoals.AddRange(goalList.Goals); } } if (availableGoals.Count > 0) { quest.Goal = questData.QuestGoals[availableGoals[Random.Range(0, availableGoals.Count)]]; } else { Debug.LogError("No goal for quest " + quest.Dungeon + " " + quest.Difficulty); } availableGoals.Clear(); } } }
public void Save(bool forceSaveToDB) { if (mLoaded) { if (player == null) { return; } var character = GetComponent <PlayerCharacterObject>(); if (character == null) { return; } try { var app = nebulaObject.mmoWorld().application; InventoryDatabase.instance(app).SaveInventory(character.characterId, player.Inventory); StationDatabase.instance(app).SaveStation(character.characterId, player.Station); CharacterDatabase.instance(app).SaveCharacter(character.characterId, player.GetPlayerCharacter()); ShipModelDatabase.instance(app).SaveShipModel(character.characterId, GetComponent <PlayerShip>().shipModel); SkillDatabase.instance(app).SaveSkills(character.characterId, GetComponent <PlayerSkills>().GetSave()); WeaponDatabase.instance(app).SaveWeapon(character.characterId, player.GetComponent <ShipWeapon>().GetSave()); PassiveBonusesDatabase.instance(app).SavePassiveBonuses(character.characterId, player.GetComponent <PassiveBonusesComponent>().GetSave()); TimedEffectsDatabase.instance(app).SaveTimedEffects(character.characterId, player.GetComponent <PlayerTimedEffects>().GetInfo()); PetDatabase.instance(app).SavePets(character.characterId, player.GetComponent <PetManager>().pets); ContractDatabase.instance(app).SaveContracts(character.characterId, player.GetComponent <ContractManager>().GetSave()); AchievmentDatabase.instance(app).SaveAchievment(character.characterId, player.GetComponent <AchievmentComponent>().GetSave()); QuestDatabase.instance(app).SaveQuests(character.characterId, player.GetComponent <QuestManager>().GetSave()); //QuestDatabase.instance(app).SaveQuests(character.characterId, player.GetComponent<QuestManager>().GetInfo()); //DialogDatabase.instance(app).SaveDialogs(character.characterId, player.GetComponent<DialogManager>().GetInfo()); } catch (Exception exception) { log.Error("handled exception at Player Loaded Object"); log.Error(exception.Message); log.Error(exception.StackTrace); } } }
// Use this for initialization void Start() { questDb = GetComponent <QuestDatabase> (); }
public void QuestItems() { scrollPosition = GUILayout.BeginScrollView(scrollPosition); for (int i = 0; i < QuestDatabase.GetAssetCount(); i++) { QuestAsset asset = QuestDatabase.GetAt(i); if (asset != null) { GUILayout.BeginHorizontal(EditorStyles.toolbar); GUILayout.Label(string.Format("ID: {0}", asset.ID.ToString("D3")), GUILayout.Width(60)); bool clicked = GUILayout.Toggle(asset.ID == activeID, asset.Name, ToggleButtonStyle); if (clicked != (asset.ID == activeID)) { if (clicked) { activeID = asset.ID; GUI.FocusControl(null); } else { activeID = -1; } } if (GUILayout.Button("x", EditorStyles.toolbarButton, GUILayout.Width(30)) && EditorUtility.DisplayDialog("Delete Quest Item", "Are you sure you want to delete " + asset.Name + " Consumable?", "Delete", "Cancel")) { QuestDatabase.Instance.RemoveAt(i); } GUILayout.EndHorizontal(); if (activeID == asset.ID) { EditorGUI.BeginChangeCheck(); GUILayout.BeginVertical("Box"); GUILayout.BeginHorizontal(); //ITEM SPRITE GUILayout.BeginVertical(GUILayout.Width(75)); //begin vertical asset.Icon = (Sprite)EditorGUILayout.ObjectField(asset.Icon, typeof(Sprite), false, GUILayout.Width(72), GUILayout.Height(72)); GUILayout.Label("Item Sprite", GUILayout.Width(72)); GUILayout.EndVertical(); //end vertical //ITEM CLASS GUILayout.BeginVertical(); //begin vertical GUILayout.Label("Item Class: " + asset.IType.ToString(), EditorStyles.boldLabel); //NAME GUILayout.BeginHorizontal(); GUILayout.Label("Name", GUILayout.Width(80)); asset.Name = EditorGUILayout.TextField(asset.Name); GUILayout.EndHorizontal(); //DESCRIPTION GUILayout.BeginHorizontal(); GUILayout.Label("Description", GUILayout.Width(80)); asset.Description = EditorGUILayout.TextArea(asset.Description, GUILayout.MinHeight(30)); GUILayout.EndHorizontal(); //COST GUILayout.BeginHorizontal(); GUILayout.Label("Cost", GUILayout.Width(80)); asset.Cost = EditorGUILayout.IntField(asset.Cost); GUILayout.EndHorizontal(); //STACKABLE GUILayout.BeginHorizontal(); GUILayout.Label("Stackable", GUILayout.Width(80)); GUILayout.BeginVertical(); asset.Stackable = EditorGUILayout.BeginToggleGroup("Enabled", asset.Stackable); GUILayout.BeginHorizontal(); GUILayout.Label("Stack Size", GUILayout.Width(80)); asset.StackSize = EditorGUILayout.IntSlider(asset.StackSize, 2, 64); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.EndHorizontal(); EditorGUILayout.EndToggleGroup(); GUILayout.BeginHorizontal(); GUILayout.Label("Level", GUILayout.Width(80)); asset.Level = EditorGUILayout.IntSlider(asset.Level, 1, 99); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("Weight", GUILayout.Width(80)); asset.Weight = EditorGUILayout.IntSlider(asset.Weight, 0, 99); GUILayout.EndHorizontal(); GUILayout.Label("QuestItem Variables", EditorStyles.boldLabel); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.EndVertical(); if (EditorGUI.EndChangeCheck()) { EditorUtility.SetDirty(QuestDatabase.Instance); } } } } GUILayout.EndScrollView(); }
private void Start() { questDatabase = GetComponent <QuestDatabase>(); }
void Start() { if(PlayerPrefs.HasKey ("SaveNomePersonagem1")||PlayerPrefs.HasKey ("SaveNomePersonagem2") ||PlayerPrefs.HasKey ("SaveNomePersonagem3")){ //Load: }else{ //NewGame: EscHeroi.SetActive(false); //SelecionarSave.SetActive(true); CriarPersonagem.SetActive(true); } obj = GameObject.Find("GerencBut"); MenuInf = (VisionBarraInf)obj.GetComponent (typeof(VisionBarraInf)); script3 = (LeitorArquivo)gameObject.GetComponent (typeof(LeitorArquivo)); script4 = (GerenciadorMissao)gameObject.GetComponent (typeof(GerenciadorMissao)); qData = (QuestDatabase)questDatabase.GetComponent(typeof(QuestDatabase)); startingVariables (); setingStartingMissionsTXT (); }
protected void OnEnable() { database = QuestDatabase.Load(); richTextStyle.richText = true; }
protected void OnEnable() { database = QuestDatabase.Load(); richTextStyle.richText = true; }
// Use this for initialization void Start() { obj = GameObject.Find ("Gerenciador"); obj2 = GameObject.Find ("BagImage"); obj3 = GameObject.Find("Global"); obj4 = GameObject.Find("QuestDatabase"); //log = (LogScript)obj.GetComponent(typeof(LogScript)); criarPersonagem = (CriarPersonagem)obj3.GetComponent(typeof(CriarPersonagem)); reader = (LeitorArquivo)obj.GetComponent(typeof(LeitorArquivo)); qData = (QuestDatabase)obj4.GetComponent(typeof(QuestDatabase)); script4 = (GerenciadorMissao)obj.GetComponent (typeof(GerenciadorMissao)); questScript = (Missao)obj.GetComponent (typeof(Missao)); inventory = (Inventory)obj2.GetComponent (typeof(Inventory)); setSlotScripts[0] = (SetSlotScript)GameObject.Find("SlotWeapon").GetComponent(typeof(SetSlotScript)); setSlotScripts[1] = (SetSlotScript)GameObject.Find("SlotArmor").GetComponent(typeof(SetSlotScript)); setSlotScripts[2] = (SetSlotScript)GameObject.Find("SlotTrinket").GetComponent(typeof(SetSlotScript)); setSlotScripts[3] = (SetSlotScript)GameObject.Find("SlotPet").GetComponent(typeof(SetSlotScript)); }