Esempio n. 1
0
    void Start()
    {
        _data   = GameObject.Find("QuestManager").GetComponent <dataQuest>();
        _Status = GameObject.Find("Player").GetComponent <PlayerStatus>();
        inv     = GameObject.Find("InventoryManager").GetComponent <Inventory>();

        for (int i = 1; i <= 3; i++)
        {
            GetComponent <ShowSave>().Show(i);
        }

        AutoLoad();
        _Status.CalculateStatus();
        DelStatus();

        _Status.CurrentHp = _Status.MaxHp;
        _Status.CurrentMp = _Status.MaxMp;

        _data.DataTalk();
        _data.LoadQuest();
    }
Esempio n. 2
0
 void Start()
 {
     _data = GameObject.Find("QuestManager").GetComponent <dataQuest>();
 }
Esempio n. 3
0
 void Start()
 {
     _dataQuest = GameObject.Find("QuestManager").GetComponent <dataQuest>();
     _npc       = GameObject.Find("QuestManager").GetComponent <NPC_Talk>();
     cas        = GameObject.Find("DataCenter").GetComponent <CheckActiveScreen>();
 }
Esempio n. 4
0
    IEnumerator Die(float waitTime)
    {
        if (!_Check)
        {
            _Check = true;
            _anim.SetBool("Die", true);
            GameObject.Find("BossSounds").transform.GetChild(0).GetComponent <AudioSource>().Play();

            dataQuest _data = GameObject.Find("QuestManager").GetComponent <dataQuest>();
            _data._Stage = BossStage.ToString();

            yield return(new WaitForSeconds(waitTime));

            A_screen.Hide_AllScreen();
            A_screen.EndStage.SetActive(true);
            A_screen.EndButtom.SetActive(true);

            EndStage  _end = GameObject.Find("EndStage Panel").GetComponent <EndStage>();
            UI_Screen data = GameObject.Find("Canvas").GetComponent <UI_Screen>();


            if (levelStage == "S")
            {
                _end.itemAmount = 4;
                sumExp         += ((bossExp * 2) + (bossExp / 2));
            }
            else if (levelStage == "A")
            {
                _end.itemAmount = 3;
                sumExp         += (bossExp * 2);
            }
            else if (levelStage == "B")
            {
                _end.itemAmount = 2;
                sumExp         += ((bossExp * 2) - (bossExp / 2));
            }
            else if (levelStage == "C")
            {
                _end.itemAmount = 1;
                sumExp         += bossExp;
            }

            P_Sta.Exp      += Convert.ToInt32(sumExp);
            data.data.text += "\n ท่านได้รับค่าประสบการณ์ " + sumExp + " หน่วย";

            if (BossStage.ToString() == "Stage_1")
            {
                _end.addItemEnd(_end.itemAmount, itemAd, 3);
            }
            else if (BossStage.ToString() == "Stage_2")
            {
                _end.addItemEnd(_end.itemAmount, itemAd2, 6);
            }
            else if (BossStage.ToString() == "Stage_3")
            {
                _end.addItemEnd(_end.itemAmount, itemAd3, 3);
            }

            GameObject.Find("InventoryManager").GetComponent <Inventory>().ScrollDown();

            _end.LavelStage = levelStage;
            _end.TimeStage  = timeStage;
            _data._Degree   = _end.LavelStage;
            _data.QuestEnd();
            Destroy(gameObject, 1.4f);
        }
    }