/// <summary> /// Set Up all the enabled Mask parts on the UI /// </summary> private void setUpPool(MaskPool pool, Dictionary <Sprite, bool> spritesDict) { List <Sprite> unlockedMasks = MaskPartContainer.GetUnlockedMasks(spritesDict); ListUtils.Shuffle(unlockedMasks); pool.masksSprites.AddRange(unlockedMasks); pool.ShowMasks(); }
/// <summary> /// fill the unlockedMaskPart list with the unlocked part from the partList /// </summary> /// <param name="partList"></param> private void FillPartList(Dictionary <Sprite, bool> partList) { if (IsPurchase) { unlockedMaskParts.AddRange(MaskPartContainer.GetLockedMasks(partList)); } else { unlockedMaskParts.AddRange(MaskPartContainer.GetUnlockedMasks(partList)); } }
/// <summary> /// Event fire when PlayerSettingsScene is fullyloaded /// </summary> /// <param name="arg0"></param> /// <param name="arg1"></param> private void PlayerSettingsScene_Loaded(Scene arg0, LoadSceneMode arg1) { SceneManager.sceneLoaded -= PlayerSettingsScene_Loaded; GameObject.Find("GoldCount").GetComponent <TextMeshProUGUI>().text = SaveManager.Instance.state.gold.ToString(); GameObject.Find("DaysCount").GetComponent <TextMeshProUGUI>().text = SaveManager.Instance.state.completedDays.ToString(); var master = DebugUtils.GetGameMaster().GetComponent <MaskPartContainer>(); var unlockedMaskParts = MaskPartContainer.GetUnlockedMasks(master.ShapeParts).Count; unlockedMaskParts += MaskPartContainer.GetUnlockedMasks(master.MouthParts).Count; unlockedMaskParts += MaskPartContainer.GetUnlockedMasks(master.EyesParts).Count; GameObject.Find("MaskCount").GetComponent <TextMeshProUGUI>().text = unlockedMaskParts.ToString(); }
public string GeneratedSentence(int clientNumber) { MaskPartContainer container = DebugUtils.GetGameMaster().GetComponent <MaskPartContainer>(); MaskCompletePool pool = new MaskCompletePool( MaskPartContainer.GetUnlockedMasks(container.EyesParts), MaskPartContainer.GetUnlockedMasks(container.ShapeParts), MaskPartContainer.GetUnlockedMasks(container.MouthParts)); victoriousPick.Clear(); int numComponents = DifficultyScale(clientNumber); MaskComponents mask = RandomDemandGenerator.GenerateMask(pool, numComponents); //add non-empty parts to the victory list foreach (var elem in mask.toList().Where(n => n != "")) { victoriousPick.Add(elem); } return(RandomDemandDialogGen.GenerateSentence(mask, numComponents)); }