Exemple #1
0
 //트리거를 당기면 문이 열림.
 void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player" && num_open == 1)
     {
         //퍼즐이 풀려있으면
         if (isSolved)
         {
             //닫혀있으면
             if (isOpen == false)
             {
                 _audio.AudioPlay();
                 isOpen = true;
                 _animator.SetBool("close", false);
                 _animator.SetBool("open", true);
                 num_open -= 1;
             }
             else
             {
                 _animator.SetBool("open", false);
                 _animator.SetBool("close", true);
                 isOpen = false;
             }
         }
         //퍼즐 안풀려있으면
         else
         {
             NotSolvedDialogue.GetComponent <DialogueTrigger>().TriggerDialogue();
         }
     }
 }
        private void reActivate()
        {
            Object     currentTarget    = target ?? gameObject;
            GameObject targetGameObject = currentTarget as GameObject;


            if (triggerCount < 1)
            {
                _audio.AudioPlay();
                triggerCount = 1;
                exp.addforce();
                targetGameObject.SetActive(false);
            }
        }