コード例 #1
0
 public void OnDropped()
 {
     user.isInteracting = false;
     user = null;
     NeedleController.playerController = null;
     NeedleController.isDoingQTE       = false;
 }
コード例 #2
0
 private void OnCollisionExit(Collision collision)
 {
     if (collision.gameObject.tag == "Player")
     {
         thisPlayer = null;
         xButton.SetActive(false);
         redCross.SetActive(false);
         InteractButton.SetActive(false);
     }
 }
コード例 #3
0
 private void OnCollisionStay(Collision collision)
 {
     if (collision.gameObject.tag == "Player")
     {
         thisPlayer = collision.gameObject.GetComponent <PlayerRigidBodyEntity>();
         if (thisPlayer.isInteracting)
         {
             xButton.SetActive(false);
             redCross.SetActive(false);
             if (gameObject.tag == "CraftTable" || gameObject.tag == "MovePanel")
             {
                 InteractButton.SetActive(true);
             }
         }
         else
         {
             if (gameObject.tag == "CraftTable")
             {
                 if (UIManager.instance.scrapsAmount > 0)
                 {
                     redCross.SetActive(false);
                 }
                 else
                 {
                     redCross.SetActive(true);
                 }
             }
             else if (gameObject.tag == "GunPanel")
             {
                 if (UIManager.instance.ammoAmount > 0)
                 {
                     redCross.SetActive(false);
                 }
                 else
                 {
                     redCross.SetActive(true);
                 }
             }
             else if (gameObject.tag == "Tank")
             {
                 if (UIManager.instance.fuelJerrycanAmount > 0)
                 {
                     redCross.SetActive(false);
                 }
                 else
                 {
                     redCross.SetActive(true);
                 }
             }
             xButton.SetActive(true);
             InteractButton.SetActive(false);
         }
     }
 }
コード例 #4
0
 public void ActionResurrect()
 {
     if (downedPlayer == null)
     {
         return;
     }
     if (canResurrect)
     {
         downedPlayer.IsResurrected();
         downedPlayer = null;
         canResurrect = false;
     }
 }
コード例 #5
0
 private void OnCollisionStay(Collision collision)
 {
     if (collision.gameObject.tag == "FuelBase" || collision.gameObject.tag == "GasCan" || collision.gameObject.tag == "MedicBase" || collision.gameObject.tag == "MedicKit")
     {
         canGrab = true;
         if (!isGrabing)
         {
             ressourceItem = collision.gameObject;
         }
     }
     else if (collision.gameObject.tag == "Player")
     {
         if (collision.gameObject.GetComponent <PlayerRigidBodyEntity>().isDown&& holdMedikit)
         {
             canResurrect = true;
             downedPlayer = collision.gameObject.GetComponent <PlayerRigidBodyEntity>();
         }
     }
     else if (collision.gameObject.tag == "MovePanel")
     {
         canInteractQTE = true;
         if (!isInteracting)
         {
             interactItem = collision.gameObject;
         }
     }
     else if (collision.gameObject.tag == "GunPanel")
     {
         canInteractQTE = true;
         if (!isInteracting)
         {
             interactItem = collision.gameObject;
         }
     }
     else if (collision.gameObject.tag == "CraftTable")
     {
         canInteractQTE = true;
         if (!isInteracting)
         {
             interactItem = collision.gameObject;
         }
     }
     else if (collision.gameObject.tag == "Tank")
     {
         canInteractQTE = true;
         if (!isInteracting)
         {
             interactItem = collision.gameObject;
         }
     }
 }
コード例 #6
0
 private void OnCollisionExit(Collision collision)
 {
     if (collision.gameObject.tag == "FuelBase" || collision.gameObject.tag == "GasCan" || collision.gameObject.tag == "MedicBase" || collision.gameObject.tag == "MedicKit")
     {
         canGrab       = false;
         ressourceItem = null;
     }
     else if (collision.gameObject.tag == "Player" && holdMedikit)
     {
         if (collision.gameObject.GetComponent <PlayerRigidBodyEntity>().isDown)
         {
             canResurrect = false;
             downedPlayer = null;
         }
     }
     else if (collision.gameObject.tag == "MovePanel")
     {
         canInteractQTE = false;
         interactItem   = null;
     }
     else if (collision.gameObject.tag == "GunPanel")
     {
         canInteractQTE = false;
         interactItem   = null;
     }
     else if (collision.gameObject.tag == "CraftTable")
     {
         canInteractQTE = false;
         interactItem   = null;
     }
     else if (collision.gameObject.tag == "Tank")
     {
         canInteractQTE = false;
         interactItem   = null;
     }
 }