コード例 #1
0
    public void OnClick()
    {
        if (CategoryChanger.getCategory() == "kame")
        {
            if (language == "ja")
            {
                title.text  = "中国留学生之父・松本龟次郎";
                BtnMsg.text = "Japanese version\n中国人留学生教育の父・松本亀次郎";
                languageChanger.GetComponentInChildren <Text>().text = "日本語版";
                language = "ch";
            }
            else
            {
                title.text  = "中国人留学生教育の父・松本亀次郎";
                BtnMsg.text = "Chinese version\n中国留学生之父・松本亀次郎";
                languageChanger.GetComponentInChildren <Text>().text = "中文版";
                language = "ja";
            }
        }

        categoryChanger.GetComponent <Image>().sprite = Resources.Load <Sprite>($"Images/btn/kame_{language}");
        for (int i = 0; i < 5; i++)
        {
            Movies[i].GetComponent <Image>().sprite = Resources.Load <Sprite>($"Images/kame/{i + 1}_{language}");
        }
    }
コード例 #2
0
    void Start()
    {
        videoIndex = LocateToVideoPlayer.GetVideoIndex();
        var language = LanguageChanger.GetLanguage();
        var category = CategoryChanger.getCategory();
        //Debug.Log(videoIndex);

        /*You can select videoClip easily to set $category, $videoIndex, $language in this code.*/
        var videoClip = Resources.Load <VideoClip>($"Videos/{category}/{videoIndex}_{language}");

        rawImage.GetComponent <VideoPlayer>().source = VideoSource.VideoClip;
        rawImage.GetComponent <VideoPlayer>().clip   = videoClip;
        length = rawImage.GetComponent <VideoPlayer>().clip.length;

        rawImage.GetComponent <VideoPlayer>().Play();
    }