Пример #1
0
 private void OnCollisionStay(Collision other)
 {
     if (other.gameObject.name == "Player")
     {
         if (Event_Manager.isEventActive(1, 2))
         {
             if (Input.GetKeyDown(KeyCode.E))
             {
                 isActive = true;
             }
             else if (Input.GetKeyUp(KeyCode.E))
             {
                 timer = 0.0f;
             }
         }
     }
 }
Пример #2
0
 private void OnTriggerStay(Collider other)
 {
     if (other.gameObject.name == "Player")
     {
         Debug.Log("Bunker");
         if (Event_Manager.isEventActive(1, 2))
         {
             if (Input.GetKeyDown(KeyCode.E))
             {
                 isActive = true;
             }
             else if (Input.GetKeyUp(KeyCode.E))
             {
                 timer = 0.0f;
             }
         }
     }
 }
Пример #3
0
    private void OnCollisionStay(Collision collision)
    {
        if (collision.gameObject.name == "Player" && eventIsActive)
        {
            if (!isNew && Event_Manager.isEventActive(2, 2))
            {
                if (timer <= 10.0f && timer > 0.0f)
                {
                    timer       -= Time.deltaTime;
                    bPrompt.text = "Repair Time: " + timer.ToString()[0] + timer.ToString()[1] + timer.ToString()[2] + timer.ToString()[3] + "s";
                }
                else if (timer <= 0.0f)
                {
                    //Destroy(smokeSpawn);
                    //smokeSpawned = false;
                    timer        = 0.0f;
                    bPrompt.text = "";
                    Event_Manager.instance.gennyReplaced = true;
                }
            }
            else
            {
                if (!promptSpawned && !Event_Manager.instance.carrying && isNew)
                {
                    bPrompt.text              = "Press 'E' to Carry";
                    promptSpawned             = true;
                    ButtonPrompt.promptActive = false;
                }

                if (Input.GetKeyDown(KeyCode.E))
                {
                    bPrompt.text                    = "";
                    promptSpawned                   = false;
                    ButtonPrompt.promptActive       = false;
                    Event_Manager.instance.carrying = true;
                }
            }
        }
    }
Пример #4
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.name == "Player")
     {
         if (Event_Manager.isEventActive(1, 2))
         {
             if (!ButtonPrompt.promptActive)
             {
                 bPrompt.text = "Press 'E' To Turn On";
                 ButtonPrompt.promptActive = true;
             }
         }
         else if (!lightsAreOff)
         {
             if (!ButtonPrompt.promptActive)
             {
                 bPrompt.text = "This is used to turn the power to the farm on.";
                 ButtonPrompt.promptActive = true;
             }
         }
     }
 }