/* DESC :> * 갈비를 스토브에 올림 */ public void SetGalbi(int id) { InGameInputController.getInstance.AddTouchableObject(ingredients.galbi); goParents.galbi.SetActive(true); goParents.sauce.SetActive(false); goParents.powder.SetActive(false); ingredients.galbi.SetIngredient(IngredientManager.getInstance.GetIngredient(EIngredientType.Galbi, id)); images.galbi.sprite = resourcesManager.CreateSprite(ingredients.galbi.GetGalbiPath(1, true), new Vector2(0.5f, 0.5f)); images.galbi.SetNativeSize(); images.sauce.sprite = resourcesManager.CreateSprite(ingredients.galbi.GetSaucePath(true), new Vector2(0.5f, 0.5f)); images.sauce.SetNativeSize(); images.powder.sprite = resourcesManager.CreateSprite(ingredients.galbi.GetPowderPath(true), new Vector2(0.5f, 0.5f)); images.powder.SetNativeSize(); Rect rect = galbiRectTrasnform.rect; galbiBox.size = new Vector3(rect.width, rect.height, 1.0f); }
public void StartTutorial(InGameCookingController cookingCtrl, InGameNyangController nyangCtrl) { GameObject customerGO = GameObjectHelper.Find("SetCostomer"); GameObject cookingGO = GameObjectHelper.Find("Cooking"); GameObject increaseMoney = GameObjectHelper.Find("IncreaseMoney"); GameObject galbiUI = GameObjectHelper.Find("SelectMeatUI"); GameObject ingredientUI = GameObjectHelper.Find("SelectSauceUI"); GameObject allBlock = GameObjectHelper.Find("AllBlocking"); GameObject optionBlock = GameObjectHelper.Find("OptionBlocking"); GameObject subButtonBlock = GameObjectHelper.Find("SubButtonBlocking"); GameObject storeBlock = GameObjectHelper.Find("StoreBlocking"); GameObject ingredientBlock = GameObjectHelper.Find("IngredientBlocking"); GameObject galbiBlock = GameObjectHelper.Find("GalbiBlocking"); GameObject cookingBlock = GameObjectHelper.Find("CookingBlocking"); GameObject choiceGalbiBlock = GameObjectHelper.Find("ChoiceGalbiBlocking"); GameObject choiceIngredientBlock = GameObjectHelper.Find("ChoiceIngredientBlocking"); imagePooling = gameObject.AddComponent <ImagePoolingManager>(); GameObject talk = GameObjectHelper.Find("Image (Talk)"); talk.SetActive(true); ResourcesManager resourceManager = ResourcesManager.getInstance; Vector2 centerPivot = new Vector2(0.5f, 0.5f); TutorialNeededIngredient galbiSetting = new TutorialNeededIngredient(EIngredientType.Galbi, 1, 1); TutorialNeededIngredient sauceSetting = new TutorialNeededIngredient(EIngredientType.Sauce, 2, 1); TutorialNeededIngredient powderSetting = new TutorialNeededIngredient(EIngredientType.Powder, 2, 1); TutorialSpawnNyang spawnNyang = new TutorialSpawnNyang(nyangCtrl.spawnManager, 1); TutorialNyangSetActive nyangStateFalse = new TutorialNyangSetActive(false); TutorialScript tuto1 = new TutorialScript(talk.FindChild("Label (Talk)").GetComponent <Text>(), "안녕? 오늘은 지각이네?\n손님냥들이 기다리겠어"); TutorialSetActive blocking2_1 = new TutorialSetActive(allBlock, false); TutorialClearImage imageClear2 = new TutorialClearImage(imagePooling); TutorialSpawnImage spawnImage2_1 = new TutorialSpawnImage(imageClear2, imagePooling, resourceManager.CreateSprite("tuto_hand", centerPivot), new Vector2(315, 540)); TutorialSpawnImage spawnImage2_2 = new TutorialSpawnImage(imageClear2, imagePooling, resourceManager.CreateSprite("tuto_arrow", centerPivot), new Vector2(390, 540)); TutorialSpawnImage spawnImage2_3 = new TutorialSpawnImage(imageClear2, imagePooling, resourceManager.CreateSprite("tuto_shadow", centerPivot), new Vector2(470, 540)); TutorialSpawnImage spawnImage2_4 = new TutorialSpawnImage(imageClear2, imagePooling, resourceManager.CreateSprite("tuto_arrow", centerPivot), new Vector2(800, 500), -90); TutorialSpawnBlackImage spawnImage2_5 = new TutorialSpawnBlackImage(customerGO, imageClear2, imagePooling, resourceManager.CreateSprite(string.Format("{0}_order", NyangManager.getInstance.GetNyang(1).name, centerPivot), centerPivot), new Vector2(540, 1226), new Vector3(2.0f, 2.0f, 2.0f)); TutorialNyangSetActive nyangStateTrue = new TutorialNyangSetActive(true); TutorialSkipScript tuto2 = new TutorialSkipScript(talk.FindChild("Label (Talk)").GetComponent <Text>(), "\n\n손냥이를 이동시켜\n손님석에 앉혀봐"); TutorialSeatNyang seatedNyang = new TutorialSeatNyang(cookingCtrl); TutorialClearImage imageClear3 = new TutorialClearImage(imagePooling); TutorialSpawnImage spawnImage3_1 = new TutorialSpawnImage(imageClear3, imagePooling, resourceManager.CreateSprite("tuto_arrow", centerPivot), new Vector2(540, 810), -90); TutorialSetRecipe setRecipe = new TutorialSetRecipe(cookingCtrl, 5); TutorialScript tuto3 = new TutorialScript(talk.FindChild("Label (Talk)").GetComponent <Text>(), "지붕위의 레시피를 잘봐"); TutorialSetActive blocking4_1 = new TutorialSetActive(galbiBlock, false); TutorialClearImage imageClear4 = new TutorialClearImage(imagePooling); TutorialSpawnImage spawnImage4_1 = new TutorialSpawnImage(imageClear4, imagePooling, resourceManager.CreateSprite("tuto_icon_1", centerPivot), new Vector2(270, 540)); TutorialSpawnImage spawnImage4_2 = new TutorialSpawnImage(imageClear4, imagePooling, resourceManager.CreateSprite("tuto_arrow", centerPivot), new Vector2(368, 540)); TutorialSpawnImage spawnImage4_3 = new TutorialSpawnImage(imageClear4, imagePooling, resourceManager.CreateSprite("obj_food_1", centerPivot), new Vector2(490, 540)); TutorialSpawnImage spawnImage4_4 = new TutorialSpawnImage(imageClear4, imagePooling, resourceManager.CreateSprite("tuto_arrow", centerPivot), new Vector2(960, 1720), -90); TutorialSkipScript tuto4 = new TutorialSkipScript(talk.FindChild("Label (Talk)").GetComponent <Text>(), "\n\n먼저 분홍색 박스에서\n갈비를 꺼내보자"); TutorialWaitGameObjectActiveState galbiButtonWait = new TutorialWaitGameObjectActiveState(galbiUI, true); TutorialSetActive blocking4_2 = new TutorialSetActive(choiceGalbiBlock, true); TutorialSetActive blocking4_3 = new TutorialSetActive(ingredientBlock, false); TutorialWaitStateCompleted waitState4 = new TutorialWaitStateCompleted(cookingCtrl, ECookingState.SWIPING); TutorialSetActive blocking5_1 = new TutorialSetActive(choiceGalbiBlock, false); TutorialSetActive blocking5_2 = new TutorialSetActive(galbiBlock, true); TutorialSetActive blocking5_3 = new TutorialSetActive(ingredientBlock, true); TutorialClearImage imageClear5 = new TutorialClearImage(imagePooling); TutorialSpawnImage spawnImage5_2 = new TutorialSpawnImage(imageClear5, imagePooling, resourceManager.CreateSprite("obj_food_1", centerPivot), new Vector2(445, 540)); TutorialSpawnImage spawnImage5_1 = new TutorialSpawnImage(imageClear5, imagePooling, resourceManager.CreateSprite("tuto_arrow", centerPivot), new Vector2(320, 540), -90); TutorialSpawnImage spawnImage5_3 = new TutorialSpawnImage(imageClear5, imagePooling, resourceManager.CreateSprite("tuto_hand", centerPivot), new Vector2(475, 570)); TutorialSpawnImage spawnImage5_4 = new TutorialSpawnImage(imageClear5, imagePooling, resourceManager.CreateSprite("tuto_arrow", centerPivot), new Vector2(558, 1400), -90); TutorialSpawnImage spawnImage5_5 = new TutorialSpawnImage(imageClear5, imagePooling, resourceManager.CreateSprite("tuto_hand", centerPivot), new Vector2(578, 1460)); TutorialSkipScript tuto5 = new TutorialSkipScript(talk.FindChild("Label (Talk)").GetComponent <Text>(), "\n\n\n갈비가 잘 익도록 구워봐\n타지 않도록 얼른~"); TutorialWaitStateCompleted waitState5 = new TutorialWaitStateCompleted(cookingCtrl, ECookingState.SWIPING_END); TutorialGameObjectBlockingSetActive cookingSetFalse = new TutorialGameObjectBlockingSetActive("Cook Galbi", false); TutorialSetActive blocking6_1 = new TutorialSetActive(cookingBlock, true); TutorialSetActive blocking6_2 = new TutorialSetActive(ingredientBlock, false); TutorialClearImage imageClear6 = new TutorialClearImage(imagePooling); TutorialSpawnImage spawnImage6_1 = new TutorialSpawnImage(imageClear6, imagePooling, resourceManager.CreateSprite("tuto_icon_2", centerPivot), new Vector2(270, 540)); TutorialSpawnImage spawnImage6_2 = new TutorialSpawnImage(imageClear6, imagePooling, resourceManager.CreateSprite("tuto_arrow", centerPivot), new Vector2(372, 540)); TutorialSpawnImage spawnImage6_3 = new TutorialSpawnImage(imageClear6, imagePooling, resourceManager.CreateSprite("obj_coca_2", centerPivot), new Vector2(453, 540)); TutorialSpawnImage spawnImage6_4 = new TutorialSpawnImage(imageClear6, imagePooling, resourceManager.CreateSprite("obj_lsd_2", centerPivot), new Vector2(543, 540)); TutorialSkipScript tuto6 = new TutorialSkipScript(talk.FindChild("Label (Talk)").GetComponent <Text>(), "\n\n\n다음은 노란색 박스에 있는\n조미료를 뿌려보자"); TutorialWaitGameObjectActiveState ingredientButtonWait = new TutorialWaitGameObjectActiveState(ingredientUI, true); TutorialSetActive blocking6_3 = new TutorialSetActive(choiceIngredientBlock, true); TutorialSpawnImage spawnImage6_5 = new TutorialSpawnImage(imageClear6, imagePooling, resourceManager.CreateSprite("tuto_arrow", centerPivot), new Vector2(375, 1640), -90); TutorialSpawnImage spawnImage6_6 = new TutorialSpawnImage(imageClear6, imagePooling, resourceManager.CreateSprite("tuto_arrow", centerPivot), new Vector2(705, 1640), -90); TutorialWaitStateCompleted waitState6 = new TutorialWaitStateCompleted(cookingCtrl, ECookingState.COMPLETE); TutorialGameObjectBlockingSetActive cookingSetTrue = new TutorialGameObjectBlockingSetActive("Cook Galbi", true); TutorialSetActive blocking7_1 = new TutorialSetActive(choiceIngredientBlock, false); TutorialSetActive blocking7_2 = new TutorialSetActive(ingredientBlock, true); TutorialSetActive blocking7_3 = new TutorialSetActive(cookingBlock, false); TutorialClearImage imageClear7 = new TutorialClearImage(imagePooling); TutorialSpawnImage spawnImage7_1 = new TutorialSpawnImage(imageClear7, imagePooling, resourceManager.CreateSprite("tuto_arrow", centerPivot), new Vector2(558, 1350), -90); TutorialSkipScript tuto7 = new TutorialSkipScript(talk.FindChild("Label (Talk)").GetComponent <Text>(), "갈비가 완성됐어\n이제 손냥이에게 갈비를 줘"); TutorialWaitNyangStateCompleted waitState7 = new TutorialWaitNyangStateCompleted(cookingCtrl, ENyangState.happy); TutorialDecreaseGold decreaseGold = new TutorialDecreaseGold(300); TutorialSetActive blocking8_1 = new TutorialSetActive(allBlock, true); TutorialClearImage imageClear8 = new TutorialClearImage(imagePooling); TutorialSpawnImage spawnImage8_1 = new TutorialSpawnImage(imageClear8, imagePooling, resourceManager.CreateSprite("tuto_arrow", centerPivot), new Vector2(980, 150), 90); TutorialScript tuto8 = new TutorialScript(talk.FindChild("Label (Talk)").GetComponent <Text>(), "잘했어! 이제 혼자 할 수 있겠지?\n돈은 내가 받고 있으니 걱정마"); TutorialClearImage imageClear9 = new TutorialClearImage(imagePooling); TutorialSpawnImage spawnImage9_1 = new TutorialSpawnImage(imageClear9, imagePooling, resourceManager.CreateSprite("tuto_icon_3", centerPivot), new Vector2(390, 540)); TutorialScript tuto9 = new TutorialScript(talk.FindChild("Label (Talk)").GetComponent <Text>(), "\n\n\n갈비를 너무 오래구우면\n타버린다는거 명심해"); TutorialSetActive increaseMoneySetActive = new TutorialSetActive(increaseMoney, false); TutorialClearImage imageClear10 = new TutorialClearImage(imagePooling); TutorialSetActive setActive10 = new TutorialSetActive(cookingGO, false); TutorialNyangStateChange nyangStateChange = new TutorialNyangStateChange(customerGO, ENyangState.angry); TutorialScript tuto10 = new TutorialScript(talk.FindChild("Label (Talk)").GetComponent <Text>(), "탄갈비를 주거나 레시피대로\n굽지않으면 손냥이가 화낼거야"); TutorialSetActive setActive11 = new TutorialSetActive(customerGO, false); TutorialScript tuto11 = new TutorialScript(talk.FindChild("Label (Talk)").GetComponent <Text>(), "그럼 우리 같이 졸부가 되자!"); TutorialChangeScene tuto12 = new TutorialChangeScene(); nodes.Add(galbiSetting); nodes.Add(sauceSetting); nodes.Add(powderSetting); nodes.Add(spawnNyang); nodes.Add(nyangStateFalse); nodes.Add(tuto1); nodes.Add(blocking2_1); nodes.Add(spawnImage2_1); nodes.Add(spawnImage2_2); nodes.Add(spawnImage2_3); nodes.Add(spawnImage2_4); nodes.Add(spawnImage2_5); nodes.Add(nyangStateTrue); nodes.Add(tuto2); nodes.Add(seatedNyang); nodes.Add(imageClear2); nodes.Add(spawnImage3_1); nodes.Add(setRecipe); nodes.Add(tuto3); nodes.Add(imageClear3); nodes.Add(blocking4_1); nodes.Add(spawnImage4_1); nodes.Add(spawnImage4_2); nodes.Add(spawnImage4_3); nodes.Add(spawnImage4_4); nodes.Add(tuto4); nodes.Add(galbiButtonWait); nodes.Add(blocking4_2); nodes.Add(blocking4_3); nodes.Add(waitState4); nodes.Add(imageClear4); nodes.Add(blocking5_1); nodes.Add(blocking5_2); nodes.Add(blocking5_3); nodes.Add(spawnImage5_1); nodes.Add(spawnImage5_2); nodes.Add(spawnImage5_3); nodes.Add(spawnImage5_4); nodes.Add(spawnImage5_5); nodes.Add(tuto5); nodes.Add(waitState5); nodes.Add(imageClear5); nodes.Add(cookingSetFalse); nodes.Add(blocking6_1); nodes.Add(blocking6_2); nodes.Add(spawnImage6_1); nodes.Add(spawnImage6_2); nodes.Add(spawnImage6_3); nodes.Add(spawnImage6_4); nodes.Add(tuto6); nodes.Add(ingredientButtonWait); nodes.Add(blocking6_3); nodes.Add(spawnImage6_5); nodes.Add(spawnImage6_6); nodes.Add(waitState6); nodes.Add(imageClear6); nodes.Add(cookingSetTrue); nodes.Add(blocking7_1); nodes.Add(blocking7_2); nodes.Add(blocking7_3); nodes.Add(spawnImage7_1); nodes.Add(tuto7); nodes.Add(waitState7); nodes.Add(imageClear7); nodes.Add(decreaseGold); nodes.Add(blocking8_1); nodes.Add(spawnImage8_1); nodes.Add(tuto8); nodes.Add(imageClear8); nodes.Add(spawnImage9_1); nodes.Add(tuto9); nodes.Add(imageClear9); nodes.Add(increaseMoneySetActive); nodes.Add(nyangStateChange); nodes.Add(setActive10); nodes.Add(tuto10); nodes.Add(imageClear10); nodes.Add(setActive11); nodes.Add(tuto11); nodes.Add(tuto12); }
public void SetRecipe(int id, int galbi, int sauce, int powder) { this.id = id; this.galbi = galbi; this.sauce = sauce; this.powder = powder; if (galbiObj == null) { galbiObj = new GameObject(); galbiObj.name = "Galbi"; galbiObj.transform.SetParent(transform); galbiObj.AddComponent <Galbi>(); galbiObj.AddComponent <Image>(); galbiObj.transform.localPosition = new Vector3(-135.0f, 55.0f); galbiObj.transform.localScale = Vector3.one; } if (plus1 == null) { plus1 = new GameObject(); plus1.name = "Plus1"; plus1.transform.SetParent(transform); Text plusText1 = plus1.AddComponent <Text>(); plusText1.font = Resources.Load(ResourcePath.font, typeof(Font)) as Font; plusText1.text = "+"; plusText1.fontSize = 32; plusText1.alignment = TextAnchor.MiddleCenter; plusText1.color = Color.black; plus1.transform.localPosition = new Vector3(-25.0f, 55.0f); plus1.transform.localScale = Vector3.one; } if (powderObj == null) { powderObj = new GameObject(); powderObj.name = "Powder"; powderObj.transform.SetParent(transform); powderObj.AddComponent <Powder>(); powderObj.AddComponent <Image>(); powderObj.transform.localPosition = new Vector3(45.0f, 55.0f); powderObj.transform.localScale = Vector3.one; } if (plus2 == null) { plus2 = new GameObject(); plus2.name = "Plus2"; plus2.transform.SetParent(transform); Text plusText2 = plus2.AddComponent <Text>(); plusText2.font = Resources.Load(ResourcePath.font, typeof(Font)) as Font; plusText2.text = "+"; plusText2.fontSize = 32; plusText2.alignment = TextAnchor.MiddleCenter; plusText2.color = Color.black; plus2.transform.localPosition = new Vector3(120.0f, 55.0f); plus2.transform.localScale = Vector3.one; } if (sauceObj == null) { sauceObj = new GameObject(); sauceObj.name = "Sauce"; sauceObj.transform.SetParent(transform); sauceObj.AddComponent <Sauce>(); sauceObj.AddComponent <Image>(); sauceObj.transform.localPosition = new Vector3(195.0f, 55.0f); sauceObj.transform.localScale = Vector3.one; } ResourcesManager resourcesManager = ResourcesManager.getInstance; // DESC :> Create Galbi Image Galbi galbiComp = galbiObj.GetComponent <Galbi>(); galbiComp.SetIngredient(IngredientManager.getInstance.GetIngredient(EIngredientType.Galbi, galbi)); Image galbiImage = galbiObj.GetComponent <Image>(); if (!resourcesManager.IsExistKey(RESOURCE_TYPE.TEXTURE, galbiComp.itemName)) { resourcesManager.LoadResource(RESOURCE_TYPE.TEXTURE, galbiComp.GetResourcePath()); } Sprite galbiSprite = resourcesManager.CreateSprite(galbiComp.itemName, new Vector2(0.5f, 0.5f)); galbiImage.sprite = galbiSprite; galbiImage.SetNativeSize(); RectTransform galbiRectTransform = galbiObj.GetComponent <RectTransform> (); galbiRectTransform.sizeDelta = galbiSprite.bounds.size; // DESC :> Create Ingredient Image Powder powderComp = powderObj.GetComponent <Powder>(); powderComp.SetIngredient(IngredientManager.getInstance.GetIngredient(EIngredientType.Powder, powder)); Image powderImage = powderObj.GetComponent <Image>(); Sprite powderSprite = resourcesManager.CreateSprite(powderComp.itemName, new Vector2(0.5f, 0.5f)); powderImage.sprite = powderSprite; RectTransform powderRectTransform = powderObj.GetComponent <RectTransform> (); powderRectTransform.sizeDelta = powderSprite.bounds.size; // DESC :> Create Sauce Image Sauce sauceComp = sauceObj.GetComponent <Sauce>(); sauceComp.SetIngredient(IngredientManager.getInstance.GetIngredient(EIngredientType.Sauce, sauce)); Image sauceImage = sauceObj.GetComponent <Image>(); Sprite sauceSprite = resourcesManager.CreateSprite(sauceComp.itemName, new Vector2(0.5f, 0.5f)); sauceImage.sprite = sauceSprite; RectTransform sauceRectTransform = sauceObj.GetComponent <RectTransform> (); sauceRectTransform.sizeDelta = sauceSprite.bounds.size; }