コード例 #1
0
    private void Locate()
    {
        collections = inventory.GetAll();

        for (int i = 0; i < collections.Count; i++)
        {
            Image currentImage = Instantiate(image, new Vector3(0, -0.7f - index, 0), Quaternion.identity);
            currentImage.transform.SetParent(transform);
            currentImage.transform.localScale = new Vector3(1, 1, 1);

            CollectionButton currentCollectionButton = currentImage.GetComponent <CollectionButton>();
            //currentCollectionButton.Init(collections[i], "작은 물고기입니다.",inventory);

            Debug.Log(collections[i]);
            Image currentIcon = Instantiate(
                Resources.Load <Image>("Icons/" + collections[i].name) as Image,
                new Vector3(currentImage.transform.position.x - 2f, currentImage.transform.position.y, currentImage.transform.position.z),
                Quaternion.identity
                );

            currentIcon.transform.SetParent(currentImage.transform);
            currentIcon.transform.localScale = new Vector3(1, 1, 1);
            index++;
        }
    }
コード例 #2
0
ファイル: VideoControl.cs プロジェクト: yutongzhu/UtoVR
    public void ShowDetailFun()
    {
        if (LauncherUIManager.instance.columnType == ColumnType.RecommendVideo)
        {
            VideoPoster.texture =
                JsonDataManager.VideosDic[JsonDataManager.currentId].coverTexture;
            VideoDetailName.text =
                JsonDataManager.VideosDic[JsonDataManager.currentId].title;
            IntroduceText.text = JsonDataManager.VideosDic[JsonDataManager.currentId].subscript;

            CountryName.text = "";
            //表示该视频是否被收藏了
        }
        else
        {
            ClassifyVideoItem item = TV189MsgReciver.classifyVideosDic[JsonDataManager.currentId];
            TV189MsgReciver.instance.SetImage(item.imgM0, VideoPoster);

            VideoDetailName.text = item.title;
            IntroduceText.text   = item.description;
            CountryName.text     = item.countryName;
        }
        VideoDetailRoot.gameObject.SetActive(true);

        if (JsonDataManager.VideosDic[JsonDataManager.currentId].isCollected == false)
        {
            CollectionButton.GetComponent <Image>().sprite = NormalCollectedSprite;
        }
        else
        {
            CollectionButton.GetComponent <Image>().sprite = CollectedSprite;
        }
    }
コード例 #3
0
ファイル: VideoControl.cs プロジェクト: yutongzhu/UtoVR
    public override void ProcessEvent(MsgBase tmpMag)
    {
        switch (tmpMag.msgid)
        {
        case (ushort)UIEvent.HideVideoDetailRoot:
        {
            VideoDetailRoot.gameObject.SetActive(false);
        }
        break;

        case (ushort)UIEvent.ShowVideoDetailRoot:

        {
            Debug.Log("ShowVideoDetailRoot");
            if (LauncherUIManager.instance.columnType == ColumnType.RecommendVideo)
            {
                VideoPoster.texture =
                    JsonDataManager.VideosDic[JsonDataManager.currentId].coverTexture;
                VideoDetailName.text =
                    JsonDataManager.VideosDic[JsonDataManager.currentId].title;
                IntroduceText.text = JsonDataManager.VideosDic[JsonDataManager.currentId].subscript;

                CountryName.text = "";
                //表示该视频是否被收藏了
            }
            else
            {
                ClassifyVideoItem item = TV189MsgReciver.classifyVideosDic[JsonDataManager.currentId];
                TV189MsgReciver.instance.SetImage(item.imgM0, VideoPoster);

                VideoDetailName.text = item.title;
                IntroduceText.text   = item.description;
                CountryName.text     = item.countryName;
            }
            VideoDetailRoot.gameObject.SetActive(true);

            if (JsonDataManager.VideosDic[JsonDataManager.currentId].isCollected == false)
            {
                CollectionButton.GetComponent <Image>().sprite = NormalCollectedSprite;
            }
            else
            {
                CollectionButton.GetComponent <Image>().sprite = CollectedSprite;
            }
        }
        break;
        }
    }