Exemplo n.º 1
0
    public void TutorialInit()
    {
        gameCtrl = FindObjectOfType <InGameCookingController>();
        canvasUI = GameObject.Find("Canvas (UI)").FindChild("Panel");

        UIButtonManager btnMgr = UIButtonManager.getInstance;

        btnMgr.SetButtonMsg(GameObject.Find("MeatButton"), () => { OnShowSelectSubUI(subUIList[(int)SUB_UI_TYPE.MEAT]); });
        btnMgr.SetButtonMsg(GameObject.Find("SauceButton"), () => { OnShowSelectSubUI(subUIList[(int)SUB_UI_TYPE.SAUCE]); });

        GameObject selectCookUIObj  = GameObjectHelper.Find("SelectMeatUI");
        GameObject selectSauceUIObj = GameObjectHelper.Find("SelectSauceUI");

        subUIList.Clear();
        subUIList.Add(selectCookUIObj.GetComponent <SelectMeatUI>());
        subUIList.Add(selectSauceUIObj.GetComponent <SelectSauceUI>());

        subUIList[0].Init(IngredientManager.getInstance.GetIngredients(EIngredientType.Galbi), OnSetFoodMakeItem);
        subUIList[1].Init(IngredientManager.getInstance.GetIngredients(i => i.type == EIngredientType.Powder || i.type == EIngredientType.Sauce), OnSetFoodMakeItem);

        timerLabel     = GameObject.Find("Timer").FindChild("Label (Timer)").GetComponent <Text>();
        timerTypeLabel = GameObject.Find("Timer").FindChild("Label (Timer Type)").GetComponent <Text>();

        timerLabel.text     = string.Format("{0:00}:{1:00}", 8, 0);
        timerTypeLabel.text = "AM";

        moneyLabel      = GameObject.Find("Label (Money)").GetComponent <Text>();
        moneyLabel.text = string.Format("{0}", GoldConvert.GetGoldFormat(GlobalData.getInstance.curGold));
    }
Exemplo n.º 2
0
    public void Initialize(InGameCookingController cookingCtrl)
    {
        spawnManager   = new SpawnManager();
        arrivedManager = new ArrivedManager();

        spawnManager.Initialize(this);
        arrivedManager.Initialize(cookingCtrl, spawnManager);
    }
Exemplo n.º 3
0
    /// <summary>
    /// 음식 만들 재료 세팅 함수
    /// </summary>
    /// <param name="_id"></param>
    /// <param name="_type">고기 : 0번 소스 : 1번 가루 : 2번</param>
    private void OnSetFoodMakeItem(int _id, EIngredientType _type)
    {
        InGameCookingController cookingController = FindObjectOfType <InGameCookingController>();

        if (cookingController)
        {
            cookingController.UseIngredient(_type, _id);
        }
#if DEBUG_LOG
        Debug.Log("ITEM ID : " + _id + " TYPE : " + _type);
#endif
    }
Exemplo n.º 4
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>();
    }
Exemplo n.º 5
0
    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");
    }
Exemplo n.º 6
0
    public void InitUI()
    {
        gameCtrl = FindObjectOfType <InGameCookingController>();
        canvasUI = GameObject.Find("Canvas (UI)").FindChild("Panel");

        InitSubUIList();

        DecoManager.getInstance.Init();
        DecoManager.getInstance.ChangeDecoImage(0, "main_roof");

        IngredientStorePopup = GameObjectHelper.Find("IngredientStorePopup").GetComponent <IngredientStorePopup> ();
        decoStorePopup       = GameObjectHelper.Find("DecoStorePopup").GetComponent <DecoStorePopup>();

        UIButtonManager btnMgr = UIButtonManager.getInstance;

        btnMgr.SetButtonMsg(GameObject.Find("MatShopButton"), OnMatShopButtonClick);
        btnMgr.SetButtonMsg(GameObject.Find("HouseShopButton"), OnHouseShopButtonClick);

        btnMgr.SetButtonMsg(GameObject.Find("BuffButton"), OnBuffButtonClick);
        btnMgr.SetButtonMsg(GameObject.Find("TrashButton"), OnTrashButtonClick);

        btnMgr.SetButtonMsg(GameObject.Find("OptionButton"), OnOptionButtonClick);
        btnMgr.SetButtonMsg(GameObject.Find("CatListButton"), OnCatListButtonClick);

        btnMgr.SetButtonMsg(GameObject.Find("MeatButton"), () => { OnShowSelectSubUI(subUIList[(int)SUB_UI_TYPE.MEAT]); });
        btnMgr.SetButtonMsg(GameObject.Find("SauceButton"), () => { OnShowSelectSubUI(subUIList[(int)SUB_UI_TYPE.SAUCE]); });

        timerLabel     = GameObject.Find("Timer").FindChild("Label (Timer)").GetComponent <Text>();
        timerTypeLabel = GameObject.Find("Timer").FindChild("Label (Timer Type)").GetComponent <Text>();

        moneyLabel      = GameObject.Find("Label (Money)").GetComponent <Text>();
        moneyLabel.text = string.Format("{0}", GoldConvert.GetGoldFormat(GlobalData.getInstance.curGold));

        dayLabel      = GameObject.Find("Label(Day)").GetComponent <Text>();
        dayLabel.text = GlobalData.getInstance.curDay.ToString();

        if (GlobalData.getInstance.isAdsBuff)
        {
            GameObjectHelper.Find("Bone").FindChild("Image").GetComponent <Image>().sprite =
                ResourcesManager.getInstance.CreateSprite("main_bone_buff", new Vector2(0.5f, 0.5f), 1.0f);
            GameObjectHelper.Find("BuffButton").FindChild("Image").GetComponent <Image>().sprite =
                ResourcesManager.getInstance.CreateSprite("main_btn_buff_push", new Vector2(0.5f, 0), 1.0f);
            GameObjectHelper.Find("BuffNyang").FindChild("Image").SetActive(true);
        }
    }
Exemplo n.º 7
0
    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);
    }
Exemplo n.º 8
0
 public TutorialWaitNyangStateCompleted(InGameCookingController cooking, ENyangState _state)
 {
     cookingCtrl = cooking;
     state       = _state;
 }
Exemplo n.º 9
0
 public TutorialSetRecipe(InGameCookingController cooking, int _id)
 {
     cookingCtrl = cooking;
     id          = _id;
 }
Exemplo n.º 10
0
 public TutorialSeatNyang(InGameCookingController cooking)
 {
     cookingCtrl = cooking;
 }
Exemplo n.º 11
0
 protected override void Initialize()
 {
     uiCtrl      = GameObject.Find("Controller").GetComponent <InGameUIController>();
     cookingCtrl = FindObjectOfType <InGameCookingController>();
 }
Exemplo n.º 12
0
 public void Initialize(InGameCookingController _cookingCtrl, SpawnManager _spawnManager)
 {
     cookingCtrl  = _cookingCtrl;
     spawnManager = _spawnManager;
 }