예제 #1
0
    IEnumerator NotifyAboutTasks()
    {
        for (; ;)
        {
            if (currentTask == -1)
            {
                currentTask = 0;
            }
            if (currentTask == 0 && interactor.CanFixBridge)
            {
                currentTask = 1;
            }
            if (currentTask == 1 && Interactor.BridgeFixed)
            {
                currentTask = 2;
            }
            if (currentTask == 2 && interactor.AreBerriesCollected)
            {
                currentTask = 3;
            }
            if (currentTask == 3 && Interactor.ProvidedForFamilyBerries)
            {
                currentTask = 4;
            }
            if (currentTask == 4 && interactor.ChestsLocated)
            {
                currentTask = 5;
            }
            if (currentTask == 5 && Interactor.ProvidedForFamilyGold)
            {
                try
                {
                    GameObject go = GameObject.FindGameObjectsWithTag("Lost").FirstOrDefault(x => x.name == "LostFamily");

                    foreach (Transform t in go.transform)
                    {
                        t.gameObject.SetActive(true);
                    }
                }
                catch
                {
                    Interactor.FindTheFamilyMember = true;
                }


                currentTask = 6;
            }
            if (currentTask == 6 && Interactor.FindTheFamilyMember)
            {
                currentTask = 7;
                infoMessage.DisplayMessage("Current Task: " + playerTasks[currentTask].TaskName + " : " + playerTasks[currentTask].Message, 200F, true);

                try
                {
                    GameObject animalContainer = GameObject.FindGameObjectWithTag("AnimalContainer");
                    Vector3    pos             = animalContainer.transform.position;
                    pos.x += 0.06F;
                    Instantiate(animalContainer, pos, animalContainer.transform.rotation);

                    StartInfoCanvas.allowGod = true;
                    Player.GodMode           = true;
                    infoMessage.DisplayMessage(@"YOU FOUND ME! LOVE YOU!!! HAVE GOD MODE AS A GIFT (hit 'TAB' to enable)", 45F, true);
                    StartCoroutine(SlowTime());
                }
                catch (Exception ex)
                {
                    infoMessage.DisplayMessage("FAILED TO CREATED ALL THE ENEMIES", 10F, true);
                    Debug.Log(ex.Message);
                }
                infoMessage.SetIsFinished(true);
                break;
            }
            else
            {
                infoMessage.DisplayMessage("Current Task: " + playerTasks[currentTask].TaskName + " : " + playerTasks[currentTask].Message, 5F, false);
                yield return(new WaitForSeconds(2F));
            }
            StartInfoCanvas.currentTask = playerTasks[currentTask].TaskName + " : " + playerTasks[currentTask].Message;
        }
    }