예제 #1
0
 private void OnTriggerStay2D(Collider2D other)
 {
     //holy shit the duplicate code this is probably the shittiest code i've ever written ~ stew
     //TODO: tell stew to be a better f****n programmer this is a disgrace. stop being lazy and use a size 2 tuple
     if (ForP1 && (Input.GetButtonDown(ButtonPrompt + "P1") || Input.GetAxis(ButtonPrompt + "P1") != 0) && other.transform.name == "P1")
     {
         hasBeenTriggered = true;
         Destroy(promptP1);
         promptP1       = null;
         hasP1Activated = !IsRepeatable;
         if (dialogTrigger != null)
         {
             if (dialogTrigger.has_triggered == false)
             {
                 dialogTrigger.triggerDialogue();
                 dialogTrigger.has_triggered = true;
             }
         }
     }
     if (ForP2 && (Input.GetButtonDown(ButtonPrompt + "P2") || Input.GetAxis(ButtonPrompt + "P2") != 0) && other.transform.name == "P2")
     {
         hasBeenTriggered = true;
         Destroy(promptP2);
         promptP2       = null;
         hasP2Activated = !IsRepeatable;
         if (dialogTrigger != null)
         {
             if (dialogTrigger.has_triggered == false)
             {
                 dialogTrigger.triggerDialogue();
                 dialogTrigger.has_triggered = true;
             }
         }
     }
 }