Exemple #1
0
    public void Initialize()
    {
        waitingTime = 0.0f;

        nyangCtrl   = FindObjectOfType <InGameNyangController>();
        cookingCtrl = FindObjectOfType <InGameCookingController>();

        seatBox    = GameObject.Find("SeatedRect").GetComponent <BoxCollider>();
        defaultCam = GameObject.Find("Default Camera").GetComponent <Camera>();

        customer  = GameObject.Find("SetCostomer");
        dragedObj = GameObject.Find("DraggedObject");

        increaseMoney     = GameObjectHelper.Find("IncreaseMoney");
        increaseMoneyText = increaseMoney.FindChild("Money").FindChild("Label (Money)").GetComponent <Text>();
    }
    public void Awake()
    {
        uiCtrl = gameObject.AddComponent <InGameUIController>();
        uiCtrl.TutorialInit();

        cookingCtrl = gameObject.AddComponent <InGameCookingController>();
        cookingCtrl.TutorialInit();

        nyangCtrl = gameObject.AddComponent <InGameNyangController>();
        nyangCtrl.Initialize(cookingCtrl);

        tutoManager = TutorialManager.getInstance;
        tutoManager.StartTutorial(cookingCtrl, nyangCtrl);

        StartCoroutine("UpdateFrame");
    }
Exemple #3
0
    public void Initialize(InGameNyangController _nyangCtrl)
    {
        nyangPositions    = new List <NyangPosition>();
        nyangList         = new List <Nyang>();
        setNyangPositions = new Dictionary <ENyangPosition, Vector2>();

        nyangPositions.Add(new NyangPosition(true, ENyangPosition.A));
        nyangPositions.Add(new NyangPosition(true, ENyangPosition.B));
        nyangPositions.Add(new NyangPosition(true, ENyangPosition.C));
        nyangPositions.Add(new NyangPosition(true, ENyangPosition.D));
        nyangPositions.Add(new NyangPosition(true, ENyangPosition.E));
        nyangPositions.Add(new NyangPosition(true, ENyangPosition.F));

        setNyangPositions.Add(ENyangPosition.A, new Vector2(0, 760));
        setNyangPositions.Add(ENyangPosition.B, new Vector2(-368, 280));
        setNyangPositions.Add(ENyangPosition.C, new Vector2(-115, 350));
        setNyangPositions.Add(ENyangPosition.D, new Vector2(110, 530));
        setNyangPositions.Add(ENyangPosition.E, new Vector2(335, 394));
        setNyangPositions.Add(ENyangPosition.F, new Vector2(138, 174));

        nyangCtrl = _nyangCtrl;

        GameObject poolObj = new GameObject();

        poolObj.transform.SetParent(nyangCtrl.transform);
        pooling      = poolObj.AddComponent <NyangPoolingManager>();
        poolObj.name = "Nyang Pooling Manager";

        GameObject panelParents = GameObject.Find("Canvas").FindChild("Panel");

        nyangParents      = new GameObject();
        nyangParents.name = "Nyang";
        panelParents.AttachChild(nyangParents);

        Spawn(Random.Range(3, 5));
    }
    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);
    }