Exemplo n.º 1
0
    void BackToWashing()
    {
        KararaC.SetActive(true);
        KararaB.SetActive(false);

        KararaA.SetActive(false);


        timerStop = false;
    }
Exemplo n.º 2
0
    void Start()
    {
        clothBag.SetActive(false);//不然会显示在地铁外面

        //Set Camera position and size in stage 3
        TutorialCameraController = GameObject.Find("Main Camera").GetComponent <TutorialCameraController>();
        MainCamera = GameObject.Find("Main Camera");


        AudioManager = GameObject.Find("---AudioManager").GetComponent <AudioManager>();
        //step1
        stepCounter = 0;
        bagClick    = 0;

        myMachineState = MachineState.Empty;

        workInventory = Resources.Load <Sprite>("Images/Karara/Cloth/Inventory/work");
        workSubway    = Resources.Load <Sprite>("Images/Karara/Cloth/Subway/work");

        FishTextManager = GameObject.Find("---FishTextManager").GetComponent <FishTextManager>();

        //disable a lot of things when tutorial starts
        KararaB.SetActive(false);
        phoneAnimation.SetActive(false);

        //所有洗衣机里的衣服
        for (int i = 0; i < ClothSlotList.Count; i++)
        {
            clothSlotTable.Add(i, ClothSlotList[i]);
        }

        inventoryBubbleSR = inventoryBubble.GetComponentsInChildren <SpriteRenderer>()[1];

        for (int i = 0; i < ClothUIPosObject.Length; i++)
        {
            ClothUIPos[i] = ClothUIPosObject[i].transform.position;

            InventoryUIPos[i] = InventoryUIPosObject[i].GetComponent <RectTransform>().position;
        }
    }
Exemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        if (TutorialTransition.TransitionStage == 3)
        {
            //set inactive
            if (TutorialTransition.TrainStart)
            {
                TutorialTransition.TrainStart.SetActive(false);
            }
            TutorialTransition.ResetStage1();
            clothBag.SetActive(true);



            print("TutorialTransition =" + 3);
            Hide(TutorialTransition.TransparentButton);
            MainCamera.GetComponent <Camera>().orthographicSize = 5;
            MainCamera.GetComponent <RectTransform>().position  = new Vector3(17.5f, 0, -10f);
            TutorialTransition.trainWithWindow.SetActive(false);

            TutorialTransition.TransitionStage = 4;
            //正式开始,进入车厢
            StartCoroutine(ShowExclamation());
        }

        if (!timerStop)
        {
            if (myMachineState == MachineState.Washing)
            {
                CalculateTime();
            }

            timer += Time.deltaTime;
        }

        //在inventory里穿衣服
        //穿上工作服>>穿上鞋>>>鱼开始让人还衣服
        if (isWearingClothNum == 3 && !longTap)
        {
            longTap = true;
            StartCoroutine(LongTap());
        }

        //还掉鞋之后出现返回地铁按钮
        if (putClothBack && stepCounter == 10)
        {
            forwardOneStep = true;
        }


        if (flashing)
        {
            Flashlight.alpha = Flashlight.alpha - Time.deltaTime;
            if (Flashlight.alpha < 0)
            {
                Flashlight.alpha = 0;
                flashing         = false;
            }
        }

        //在screen1永远不显示fish scream
        if (TutorialCameraController.currentPage == 1)
        {
            Hide(scream);
        }


        if (inLoop && TutorialCameraController.currentPage == 4)
        {
            TutorialCameraController.JumpToPage(3);
            Debug.Log("what's going on????");
        }



        if (TutorialCameraController.reachTarget)
        {
            Debug.Log("reach! manager");
            Hide(scream);
            ScrollHint.SetActive(false);
            TutorialCameraController.reachTarget = false;


            if (scrollTeaching)
            {
                TutorialCameraController.allowScroll = false;

                forwardOneStep = true;
            }

            else if (inLoop && TutorialCameraController.targetPage == 2)
            {   // 前提
                Debug.Log("前提");

                if (!machineOpen)
                {
                    Debug.Log("前提");
                    EmojiBubble.SetActive(true);
                    KararaTalk(EmojiOpenDoor);
                    HintUI.SetActive(true);
                }

                TutorialCameraController.targetPage = 1;
            }
            else if (inLoop && TutorialCameraController.targetPage == 1)
            {
                TutorialCameraController.targetPage = 2;

                forwardLater = false;
                if (machineOpen)
                {
                    FishTalk("CloseDoor", true);
                }
                else
                {
                    FishTalk("Right", true);
                }
            }
            else if (inLoop && TutorialCameraController.currentPage == 3)
            {
                TutorialCameraController.JumpToPage(2);
            }
            else if (TutorialCameraController.targetPage == 1)
            {
                //FishTalk("Return this bag!",true);
                // after ins ->return prep
            }

            TutorialCameraController.targetPage = -1;
        }

        //if(currentFT.isPlaying)
        //{
        //    FishTalkNextSentence();
        //}

        //go to next step
        if (forwardOneStep)
        {
            forwardOneStep = false;
            stepCounter++;
            switch (stepCounter)
            {
            case 1:
                ShowCameraBG();
                break;

            case 2:
                StartCoroutine(BackToSubway());
                StartCoroutine(ScrollTeaching(1));
                KararaB.SetActive(true);
                break;

            case 3:
                scrollTeaching = false;

                forwardLater = true;
                FishTalk("Late", true);

                break;

            case 4:
                //鱼讲完话前进
                BagOccur();
                //包出现在screen1
                //forward的时机:衣服进了洗衣机
                break;

            case 5:
                //衣服进了洗衣机
                // PhoneOccur();
                break;

            case 6:
                BackToWashing();    //时间开始前进
                break;

            case 7:
                AfterWash();
                //从洗完到小循环前提
                break;

            case 8:
                StartCoroutine(JumpToFish());
                //小循环-小循环跳出
                break;

            case 9:
                AfterPickUpCloth();
                break;

            case 10:
                ShowInventory();
                break;

            case 11:
                //还了鞋之后就可以显示返回地铁的按钮
                StartCoroutine(ShowBackButton());
                //一定是还了一件衣服才能返回的,所以洗衣机里又有衣服了
                machineFront.sprite = fullImg;

                break;

            case 12:
                ReadyForPhoto();
                break;

            case 13:
                //照相界面下面有个黑条,改变姿势的透明图层需要变小一点
                RectTransform rt = changePostureButton.GetComponent <RectTransform>();
                rt.anchoredPosition = new Vector2(rt.anchoredPosition.x, 20);
                rt.sizeDelta        = new Vector2(700, 500);

                ShowCameraBG();
                break;

            case 14:
                GoToIns();
                break;

            case 15:
                //从ins直接回到screen2
                StartCoroutine(AfterIns());
                break;

            case 16:
                //鱼说完还包之后从screen1跳转到screen2
                StartCoroutine(ReturnPrep());
                //ReturnPrep();
                break;

            case 17:
                FishTalkLast();
                break;

            case 18:
                // StartCoroutine(ShowComic());
                // StartCoroutine(AddFans());
                Handheld.Vibrate();
                Show(mobile);
                break;
            }
        }
    }