Ejemplo n.º 1
0
 void OnTriggerStay2D(Collider2D other)
 {
     _action = _joystick.interact;
     if (other.tag == Tags.NPC)
     {
         Problem(other.name, false);
         _btnText.message      = "Talk";
         _interactHandler.talk = true;
         if (_action)
         {
             _count++;
             if (_count <= 1f)
             {
                 _talkScript.StartTalk(other.name);
                 _interactHandler.attack = false;
                 _interactHandler.talk   = true;
             }
         }
         if (other.name == Names.SPIKE_DEATH)
         {
             _count++;
             if (_count <= 1f)
             {
                 _talkScript.StartTalk(other.name);
                 _interactHandler.attack = false;
                 _interactHandler.talk   = true;
             }
         }
     }
     else if (other.tag == Tags.PICKUP)
     {
         Problem(other.name, true);
         _btnText.message      = "Take";
         _interactHandler.talk = true;
         if (_action)
         {
             _count++;
             if (_count <= 1f)
             {
                 _pickup.PickUp(other.name);
                 other.gameObject.SetActive(false);
             }
         }
     }
     else
     {
     }
 }
Ejemplo n.º 2
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == Tags.PLAYER)
     {
         if (_danger)
         {
             confirmRejectObject.SetActive(true);
             ConfrimData();
         }
         else
         {
             if (QuestData.questDone >= _questDone)
             {
                 ConfrimData();
                 confirmReject.LoadLevel();
                 //_saveLoadData.Save();
                 //_fadeBool = true;
             }
             else
             {
                 _textIndex++;
                 if (_textIndex == 1)
                 {
                     _talkScript.StartTalk(other.name);
                 }
             }
         }
     }
 }
Ejemplo n.º 3
0
    void CheckItems(Item item)
    {
        int questDone = QuestData.questDone;
        int quest     = QuestData.quest;


        switch (item)
        {
        case Item.Nothing:
            if (questDone >= 4)
            {
                _anim.SetBool(AnimNames.OPEN, true);
                _audio.PlayOneShot(audioClip, 1f);
                talk.StopTalk();
            }
            else
            {
            }
            break;

        case Item.Carrot:
            if (questDone >= 4)
            {
                _anim.SetBool(AnimNames.OPEN, true);
                _audio.PlayOneShot(audioClip, 1f);
            }
            else
            {
                //QuestData.questDone = 3;
                QuestData.questDone++;
                QuestData.quest++;
                QuestData.questProgress = 0;
                QuestData.questItems[0] = 0;
                QuestData.levelSpot     = 0;
                _anim.SetBool(AnimNames.OPEN, true);
                _audio.PlayOneShot(audioClip, 1f);
            }
            talk.StopTalk();
            break;

        case Item.Corn:
            talk.StopTalk();
            bees.SetActive(true);
            QuestData.questItems[0] = 0;
            if (quest == 3)
            {
                QuestData.questProgress = 50;
            }
            talk.StartTalk(Names.BEES);
            break;

        default:
            break;
        }
    }
Ejemplo n.º 4
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == Tags.PLAYER)
     {
         talk.StartTalk(Names.COLOR_DOOR);
         for (int i = 0; i < door.Length; i++)
         {
             door[i].SetActive(true);
             talkDoors[i].SetActive(false);
         }
     }
 }
Ejemplo n.º 5
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (ThreeItemsRequired)
     {
         if (other.tag == Tags.PLAYER)
         {
             CheckDoor2();
         }
     }
     else
     {
         if (other.tag == Tags.PLAYER)
         {
             if (snail)
             {
                 _count++;
                 if (_count == 1)
                 {
                     talk.StartTalk(Names.SNAIL);
                 }
             }
             if (trap)
             {
                 _count++;
                 if (_count == 1)
                 {
                     talk.StartTalk(Names.TRAP);
                 }
             }
             else
             {
                 CheckDoor();
             }
         }
     }
 }
Ejemplo n.º 6
0
 public void Congratz()
 {
     talk.StartTalk(Names.END);
 }