Exemplo n.º 1
0
    void Start()
    {
        FinalCameraController = GameObject.Find("Main Camera").GetComponent <FinalCameraController>();
        LevelManager          = FinalCameraController.LevelManager;
        SpriteLoader          = GameObject.Find("---SpriteLoader").GetComponent <SpriteLoader>();
        SubwayMovement        = GameObject.Find("---StationController").GetComponent <SubwayMovement>();



        NPCNames.Add("???");
        Sprite defaultProfile = Resources.Load <Sprite>("Images/NPC/X/Profile/DefaultProfile");

        NPCAvatars.Add(defaultProfile);


        foreach (KeyValuePair <string, NPC> nameNPCPair in SpriteLoader.NPCDic)
        {
            //if (nameNPCPair.Key == "X"|| nameNPCPair.Key == "Karara") continue;
            if (nameNPCPair.Key == "Karara")
            {
                continue;
            }
            NPCNames.Add(nameNPCPair.Key);
            NPCAvatars.Add(nameNPCPair.Value.profile);
            Debug.Log("station for buttons" + nameNPCPair.Key);
            bagLogoInCollection.Add(nameNPCPair.Key, nameNPCPair.Value.bagLogo);
        }


        //三个站 每站4个tab

        matchedNPCIdx.Add(new List <int> {
            0, 0, 0, 0
        });
        matchedNPCIdx.Add(new List <int> {
            0, 0, 0, 0
        });
        matchedNPCIdx.Add(new List <int> {
            0, 0, 0, 0
        });

        // station buttons don't need tab num
        InstagramController = GameObject.Find("---InstagramController").GetComponent <InstagramController>();
        BagsController      = GameObject.Find("---BagsController").GetComponent <BagsController>();

        for (int i = 0; i < NPCNames.Count; i++)
        {
            ProfileUsageState.Add("");
        }

        displayingBag     = false;
        displayingProfile = false;
        exiting           = false;


        UpdateCollectionUI();
    }
Exemplo n.º 2
0
    public void Index_ReturnsCorrectView_True()
    {
      //Arrange
      BagsController controller = new BagsController();

      //Act
      ActionResult indexView = controller.Index();

      //Assert
      Assert.IsInstanceOfType(indexView, typeof(ViewResult));
    }
        public void Create_ReturnsCorrectActionType_True()
        {
            //Arrange
            BagsController controller = new BagsController();

            //Act
            ActionResult indexView = controller.Create("Clutch");

            //Assert
            Assert.IsInstanceOfType(indexView, typeof(RedirectToActionResult));
        }
        public void Create_ReturnsCorrectActionName_True()
        {
            //Arrange
            BagsController         controller = new BagsController();
            RedirectToActionResult indexView  = controller.Create("Clutch") as RedirectToActionResult;

            //Act
            var result = indexView.ActionName;

            //Assert
            Assert.AreEqual(result, "Index");
        }
        public void Index_HasCorrectModelType_BagItemList()
        {
            //Arrange
            BagsController controller = new BagsController();
            ViewResult     indexView  = controller.Index() as ViewResult;

            //Act
            var result = indexView.ViewData.Model;

            //Assert
            Assert.IsInstanceOfType(result, typeof(List <Bag>));
        }
        public void Show_ReturnsCorrectView_True()
        {
            //Arrange
            BagsController controller  = new BagsController();
            Bag            testBag     = new Bag("Purse");
            BagItem        testBagItem = new BagItem("camera", 1, 2, true);

            testBag.AddBagItem(testBagItem);
            Console.WriteLine(testBag.GetId());

            //Act
            ActionResult showView = controller.Show(testBag.GetId());

            //Assert
            Assert.IsInstanceOfType(showView, typeof(ViewResult));
        }
        public void Show_HasCorrectModelType_Dictionary()
        {
            //Arrange
            BagsController controller  = new BagsController();
            Bag            testBag     = new Bag("Purse");
            BagItem        testBagItem = new BagItem("camera", 1, 2, true);

            testBag.AddBagItem(testBagItem);
            Console.WriteLine(testBag.GetId());
            ViewResult showView = controller.Show(testBag.GetId()) as ViewResult;

            //Act
            var result = showView.ViewData.Model;

            Console.WriteLine(result.GetType());
            Console.WriteLine(typeof(Dictionary <string, object>));
            //Assert
            Assert.AreEqual(result.GetType(), typeof(Dictionary <string, object>));
        }
Exemplo n.º 8
0
    void Start()
    {
        //find the horizontal scroll snap script
        //myHSS = GameObject.Find("Horizontal Scroll Snap").GetComponent<HorizontalScrollSnap>();

        myAudio = GetComponent <AudioSource>();

        myImage = GetComponent <Image>();
//        secondImage = GetComponentInChildren<Image>();
        hitTime = 0;


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

        ClothInMachineController = GameObject.Find("---ClothInMachineController");
        FinalCameraController    = GameObject.Find("Main Camera").GetComponent <FinalCameraController>();
        SubwayMovement           = GameObject.Find("---StationController").GetComponent <SubwayMovement>();
        cameraMovement           = GameObject.Find("Main Camera").GetComponent <CameraMovement>();
        RatingSys      = GameObject.Find("FloatingUI").GetComponent <RatingSystem>();
        SpriteLoader   = GameObject.Find("---SpriteLoader").GetComponent <SpriteLoader>();
        BagsController = GameObject.Find("---BagsController").GetComponent <BagsController>();
        ValueEditor    = GameObject.Find("---ValueEditor").GetComponent <ValueEditor>();
        AllMachines    = ClothInMachineController.GetComponent <AllMachines>();

        myAnimator = this.transform.gameObject.GetComponent <Animator>();
        //todo: generate clothes
        //Debug.Log(this.transform.gameObject.tag);

        owner = SpriteLoader.NPCDic[this.transform.gameObject.tag];

        GenerateCloth();

        if (!FinalCameraController.AllStationClothList.ContainsKey(owner.name))
        {
            FinalCameraController.AllStationClothList.Add(owner.name, new List <Sprite>());
        }


        myImage.enabled = true;
        stage           = FinalCameraController.LevelManager.stage;
    }
Exemplo n.º 9
0
    // Start is called before the first frame update
    void Start()
    {
        Debug.Log("PERSISTENT:" + Application.persistentDataPath);
        if (!isTutorial)
        {
            setting.SetActive(false);
            instruction.SetActive(false);
        }
        //        myCameraState = CameraState.Subway;
        myAppState = AppState.Mainpage;

        CameraMovement = transform.gameObject.GetComponent <CameraMovement>();

        InstagramController  = GameObject.Find("---InstagramController").GetComponent <InstagramController>();
        RatingSys            = GameObject.Find("FloatingUI").GetComponent <RatingSystem>();
        inventorySlotMgt     = GameObject.Find("---InventoryController").GetComponent <InventorySlotMgt>();
        FishBossNotification = GameObject.Find("FishBossUI").GetComponent <FishBossNotification>();
        BagsController       = GameObject.Find("---BagsController").GetComponent <BagsController>();
        FishTextManager      = GameObject.Find("---FishTextManager").GetComponent <FishTextManager>();
        FishBossNotification.HideFish();


        fishTalk.SetActive(false);
        Hide(frontPage);
        Hide(TakePhoto);
        Posture.SetActive(false);



        fishTalkText = fishTalk.gameObject.GetComponentInChildren <TextMeshPro>();
        Hide(Inventory);
        Hide(fishShoutCG);

        ChapterOneEnd = false;

        alreadyClothUI = false;
    }
Exemplo n.º 10
0
    // Start is called before the first frame update
    void Start()
    {
        FinalCameraController = GameObject.Find("Main Camera").GetComponent <FinalCameraController>();
        InstagramController   = GameObject.Find("---InstagramController").GetComponent <InstagramController>();
        BagsController        = GameObject.Find("---BagsController").GetComponent <BagsController>();
        AdsController         = GameObject.Find("---AdsController").GetComponent <AdsController>();
        AudioManager          = GameObject.Find("---AudioManager").GetComponent <AudioManager>();
        ValueEditor           = GameObject.Find("---ValueEditor").GetComponent <ValueEditor>();


        if (!FinalCameraController.isTutorial)
        {
            LevelManager = FinalCameraController.LevelManager;

            bagPosAvailable.Add(false);
            bagPosAvailable.Add(false);
            bagPosAvailable.Add(false);

            noSameBag = true;

            aSR = arrow.GetComponent <SpriteRenderer>();
            hSR = highlight.GetComponent <SpriteRenderer>();

            //tabImg0 = GameObject.Find("bag0Logo").GetComponent<Image>();
            //tabImg1 = GameObject.Find("bag1Logo").GetComponent<Image>();
            LostAndFound = GameObject.Find("Lost&Found_basket").GetComponent <LostAndFound>();

            //tab0 = GameObject.Find("bagTab0");
            //tab1 = GameObject.Find("bagTab1");
            collection.SetActive(false);
        }

        // 不知道 real timer干什么用的
        realTimer = (moveTime + stayTime + pauseTime) * 3 - timer;

        NameToStationBags.Add(bagStation0);
        NameToStationBags.Add(bagStation1);
        NameToStationBags.Add(bagStation2);


        AllDetailList.Add(detailList0);
        AllDetailList.Add(detailList1);

        DetailCG.Add(dSR1);
        DetailCG.Add(dSR2);

        currentStation = 0;

        stationTimer = stayTime;
//        CountDownTimer.text = "";

        if (!FinalCameraController.isTutorial)
        {
            //get all the doors position when game starts
            left1Pos  = left1.position.x;
            right1Pos = right1.position.x;
        }



        //get all station names into the dictionary
        for (var i = 0; i < stationNames.Count; ++i)
        {
            allStation.Add(stationNames[i], i);
        }


        //trainStop();
    }
Exemplo n.º 11
0
 // Start is called before the first frame update
 void Start()
 {
     DoneButton.gameObject.SetActive(false);
     SpriteLoader   = GameObject.Find("---SpriteLoader").GetComponent <SpriteLoader>();
     BagsController = GameObject.Find("---BagsController").GetComponent <BagsController>();
 }