Пример #1
0
    IEnumerator Wait1()
    {
        DS.Talking(17, 6, TS.GetFin());
        nowDiaID = 17;
        yield return(StartCoroutine(DiaIsFin()));

        yield return(StartCoroutine(IsEnd()));
    }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     DS = GameObject.Find("DialogueSystem").GetComponent("DialogueSystem") as DialogueSystem;
     S  = GameObject.Find("Status").GetComponent("Status") as Status;
     TS = GameObject.Find("TaskSystem").GetComponent("TaskSystem") as TaskSystem;
     S.SendMessage("SetChapter", "After");
     Obj.SetActive(false);
     isFinOK = false;
     DS.Talking(15, 6, TS.GetFin());
 }
Пример #3
0
 void OnEnable()
 {
     OneDestroy   = false;
     TwoDestroy   = false;
     ThreeDestroy = false;
     DS.Talking(9, 6, TS.GetFin());
 }
Пример #4
0
    // Use this for initialization
    void Start()
    {
        d = ds.GetComponent("DialogueSystem") as DialogueSystem;
        t = ts.GetComponent("TaskSystem") as TaskSystem;
        Task init = new Task();

        init.TaskID = 0;
        t.SetFin(init);
        d.Talking(1, 0, t.GetFin());
        _isfinOK = false;
        _isStart = false;
        //StartCoroutine(Wait());
    }
Пример #5
0
    IEnumerator Wait1()
    {
        DS.Talking(2, 0, TS.GetFin());
        nowDiaID = 2;
        yield return(StartCoroutine(DiaIsFin("Task1", 1)));

        yield return(StartCoroutine(TaskIsFin(3, 1)));

        yield return(StartCoroutine(DiaIsFin("Task2", 2)));

        yield return(StartCoroutine(TaskIsFin(4, 2)));

        FatherDestroy = true;

        /*
         * Father.transform.position = new Vector3(0, -800, 0);
         * CheckClick c = Father.GetComponent("CheckClick") as CheckClick;
         * c.isClicked = false;*/
        yield return(StartCoroutine(DiaIsFin("Task3", 3)));

        yield return(StartCoroutine(TaskIsFin(5, 3)));

        yield return(StartCoroutine(DiaIsFin("Task4", 4)));

        yield return(StartCoroutine(TaskIsFin(6, 4)));

        yield return(StartCoroutine(DiaIsFin("Task5", 5)));

        yield return(StartCoroutine(TaskIsFin(7, 5)));

        yield return(StartCoroutine(DiaIsFin("Task6", 6)));

        yield return(StartCoroutine(TaskIsFin(8, 6)));

        yield return(StartCoroutine(IsEnd()));
    }
Пример #6
0
    // Update is called once per frame
    void Update()
    {
        SceneName = Application.loadedLevelName;

        if (Application.loadedLevelName == "Game_01" || Application.loadedLevelName == "Game_02" || Application.loadedLevelName == "Game_03")
        {
            User_Canvas.SetActive(true);
            Player   = GameObject.Find("Player");
            player_t = Player.transform;
            // Drama drama = gameObject.AddComponent<Drama>() as Drama;
            //Player.SetActive(true);

            if (!drama.enabled && Chapter == "Teaching")
            {
                drama.enabled = true;
            }

            if (!drama2.enabled && Chapter == "Chapter_0")
            {
                drama2.enabled = true;
            }

            /*
             * else
             * {
             * Scene2++;
             * }
             */
            if (isLoad)
            {
                /*
                 * GameObject g = GameObject.Find("Drama");
                 * Destroy(g);*/
                GameObject value = GameObject.Find("HP_Value");
                hp_script         = value.GetComponent("Calculation") as Calculation;
                hp_script.Hp      = PlayerPrefs.GetFloat("Player_HP");
                player_t.position = new Vector3(PlayerPrefs.GetFloat("Position_x"), PlayerPrefs.GetFloat("Position_y"), PlayerPrefs.GetFloat("Position_z"));
                if (PlayerPrefs.HasKey("Time"))
                {
                    Timer t = Timer.GetComponent("Timer") as Timer;
                    t.timer = PlayerPrefs.GetFloat("Time");
                }
                isLoad = false;
            }


            if (isReset)
            {
                GameObject u = GameObject.Find("User");
                u.BroadcastMessage("Reset", 0, SendMessageOptions.RequireReceiver);
                isReset = false;
            }
        }
        else if (Application.loadedLevelName == "Black")
        {
            PrintFinDiaTask(DS.GetFin(), TS.GetFin());
            Dia.SetActive(DS.isTalk);
        }
        else
        {
            tw.SetActive(false);
            t_ok.SetActive(false);
            User_Canvas.SetActive(false);
            if (Application.loadedLevelName != "Grave" && Application.loadedLevelName != "End1" && Application.loadedLevelName != "End2" && Application.loadedLevelName != "End3")
            {
                Dia.SetActive(false);
            }
        }

        if (Chapter != "Chapter_0")
        {
            Timer.SetActive(false);
            drama2.enabled = false;
            Icon_Task.SetActive(false);

            /*
             * if (Application.loadedLevelName == "Game_01")
             * {
             * CloseThing(Task_Btn);
             *
             * }*/
        }


        if (DS.isTalk && Player != null)
        {
            Control player_c = Player.GetComponent("Control") as Control;
            player_c.CanWalk = false;
        } // if
        else if (!DS.isTalk && Player != null)
        {
            Control player_c = Player.GetComponent("Control") as Control;
            player_c.CanWalk = true;
        }



        if (Chapter == "Chapter_0")
        {
            //TS.tm.xmlDoc = XDocument.Load(Application.dataPath + "/task2.xml");
            GameObject Father  = GameObject.Find("紀宇文");
            GameObject Father2 = GameObject.Find("紀宇文_2");
            Destroy(Father);
            Destroy(Father2);
            if (Application.loadedLevelName == "Game_02")
            {
                ChangePeople();
            }
            if (TS.GetNow().Count != 0)
            {
                Icon_Task.SetActive(true);
                if (!isCountdown)
                {
                    DS.Talking(13, 6, TS.GetFin());
                    Timer.SetActive(true);
                    isCountdown = true;
                }
            } // if

            if (TS.CheckSomeTask(7) || TS.CheckSomeTaskFin(7))
            {
                s1.SetActive(true);
            }
            else
            {
                s1.SetActive(false);
            }

            if (TS.CheckSomeTask(8) || TS.CheckSomeTaskFin(8))
            {
                s2.SetActive(true);
            }
            else
            {
                s2.SetActive(false);
            }

            if (TS.CheckSomeTask(9) || TS.CheckSomeTaskFin(9))
            {
                s3.SetActive(true);
            }
            else
            {
                s3.SetActive(false);
            }

            if (TS.CheckSomeTask(10) || TS.CheckSomeTaskFin(10))
            {
                s4.SetActive(true);
            }
            else
            {
                s4.SetActive(false);
            }

            if (TS.CheckSomeTask(11) || TS.CheckSomeTaskFin(11))
            {
                s5.SetActive(true);
            }
            else
            {
                s5.SetActive(false);
            }

            if (TS.CheckSomeTask(12) || TS.CheckSomeTaskFin(12))
            {
                s6.SetActive(true);
            }
            else
            {
                s6.SetActive(false);
            }

            if (TS.CheckSomeTaskFin(10) && Application.loadedLevelName == "Game_02")
            {
                if (GameObject.Find("TV_F") != null)
                {
                    GameObject.Find("TV_F").SetActive(true);
                }
            }
        } // if
    }