void Start()
    {
        #region 抓 Mission Time Counter
        GameObject MissionTime = GameObject.FindGameObjectWithTag("Mission Time Tracker");
        counter = MissionTime.GetComponent <MissionTimeCounter>();
        #endregion

        // 初始化給的寬
        RectTransform navbarHover = Navbar.GetComponentsInChildren <Transform>()[2].GetComponent <RectTransform>();
        RectTransform footerHover = Footer.GetComponentsInChildren <Transform>()[2].GetComponent <RectTransform>();

        // 寬度
        NavbarHeight = (int)navbarHover.sizeDelta.y;
        FooterHeight = (int)footerHover.sizeDelta.y;

        // 上方
        NavStartPosY  = (int)Navbar.localPosition.y;
        NavbarEndPosY = NavStartPosY + NavbarHeight;

        // 下方
        FooterStartPosY = (int)Footer.localPosition.y;
        FooterEndPosY   = FooterStartPosY - FooterHeight;

        // 把 Movie Plane 原始的資料拿下來
        CurrentPos  = MoviePlane.localPosition;
        Currentsize = MoviePlane.sizeDelta;
    }
Example #2
0
 void Start()
 {
     #region 抓 Mission Time Counter
     GameObject MissionTime = GameObject.FindGameObjectWithTag("Mission Time Tracker");
     counter = MissionTime.GetComponent <MissionTimeCounter>();
     #endregion
     // 任務一開始
     //counter.UpgradeToNextLevel(0);
 }
Example #3
0
 void Start()
 {
     #region 抓 Mission Time Counter
     GameObject MissionTime = GameObject.FindGameObjectWithTag("Mission Time Tracker");
     counter = MissionTime.GetComponent <MissionTimeCounter>();
     #endregion
     // 把資料給進去
     Vector3 angle = Dragon.transform.localEulerAngles;
 }
Example #4
0
    void Start()
    {
        EyeTracking.Initialize();

        // 設定 Debug 的 Style
        style.normal.textColor = Color.white;
        style.fontSize         = 50;

        StartCoroutine(FPSCounter());

        #region 抓 Mission Time Counter
        GameObject MissionTime = GameObject.FindGameObjectWithTag("Mission Time Tracker");
        counter = MissionTime.GetComponent <MissionTimeCounter>();
        #endregion
    }
Example #5
0
    void Start()
    {
        #region 抓 Mission Time Counter
        GameObject MissionTime = GameObject.FindGameObjectWithTag("Mission Time Tracker");
        counter = MissionTime.GetComponent <MissionTimeCounter>();
        #endregion
        RawImage render = this.GetComponent <RawImage>();
        render.texture = movie;

        soundSource      = this.gameObject.AddComponent <AudioSource>();
        soundSource.clip = movie.audioClip;

        // 判對他有沒有影片
        if (movie != null)
        {
            movie.Play();
            soundSource.Play();

            movieEvent.SetPlayButton(false);
        }
    }
    void Start()
    {
        #region 抓 Mission Time Counter
        GameObject MissionTime = GameObject.FindGameObjectWithTag("Mission Time Tracker");
        counter = MissionTime.GetComponent <MissionTimeCounter>();
        #endregion
        RectTransform Empty = BlueDotEmpty.GetComponent <RectTransform>();
        RectTransform Full  = BlueDotFull.GetComponent <RectTransform>();
        sideEvent = this.GetComponent <MovieSideEvent>();

        #region 拿時間欄的一些數值
        TimeLineStartX = Empty.localPosition.x;
        TimeLineEndX   = Full.localPosition.x;
        TimeLineY      = Empty.localPosition.y;

        blueDotImage = BlueDotFull.GetComponent <Image>().sprite;
        #endregion
        #region 根據事件,去擺放每一個 Blue Dot
        Transform BlueDotParent = BlueDotEmpty.transform.parent;
        diff = TimeLineEndX - TimeLineStartX;
        for (int i = 0; i < EventTime.Length; i++)
        {
            float CurrentX = diff * EventTime[i] / movieM.GetMovieLength();

            #region InfoBlock 的生成
            GameObject temp;
            temp = GameObject.Instantiate(InfoBlock);
            temp.transform.SetParent(BlueDotParent, false);
            temp.transform.localPosition = new Vector3(InfoBlock.transform.localPosition.x + CurrentX,
                                                       InfoBlock.transform.localPosition.y,
                                                       InfoBlock.transform.localPosition.z);
            temp.name = "InfoBlock " + (i + 1);

            // 指定事件 (不會顯示在 Onclick 上面,但是點下去真的會有反應)
            int index = i;
            temp.GetComponent <Button>().onClick.AddListener(() => sideEvent.TimeLineImageButtonEvent(index));

            Transform[] childs = temp.GetComponentsInChildren <Transform>(true);
            childs[1].GetComponent <Image>().sprite = Image[i];
            childs[1].gameObject.SetActive(true);
            childs[2].GetComponent <Text>().text = EventPeopleName[i];
            childs[3].GetComponent <Text>().text = EventPeopleSubName[i];

            InfoBlockList.Add(temp);
            #endregion

            #region InfoBlock Dark 的生成
            temp = GameObject.Instantiate(InfoBlockDark);
            temp.transform.SetParent(BlueDotParent, false);
            temp.transform.localPosition = new Vector3(InfoBlockDark.transform.localPosition.x + CurrentX,
                                                       InfoBlockDark.transform.localPosition.y,
                                                       InfoBlockDark.transform.localPosition.z);
            temp.name = "InfoBlock Dark " + (i + 1);

            childs = temp.GetComponentsInChildren <Transform>(true);
            childs[1].GetComponent <Image>().sprite = ImageDark[i];
            childs[1].gameObject.SetActive(true);

            InfoBlockDarkList.Add(temp);
            #endregion

            #region 底下點生成
            temp      = GameObject.Instantiate(BlueDotEmpty);
            temp.name = "Event " + (i + 1);
            temp.transform.SetParent(BlueDotParent);
            temp.SetActive(true);

            // 位置設定
            RectTransform rectTemp = temp.GetComponent <RectTransform>();
            rectTemp.localPosition = new Vector3(CurrentX + TimeLineStartX, TimeLineY, 0);
            #endregion

            // 把東西加回到堆節理
            BlueDotList.Add(temp.GetComponent <Image>());
            BlueDotBool.Add(false);
            BlockBool.Add(false);
        }
        #endregion
        #region 刪除不必要的東西
        Destroy(BlueDotEmpty);
        Destroy(BlueDotFull);

        Destroy(InfoBlock);
        Destroy(InfoBlockDark);
        #endregion
    }