コード例 #1
0
    /// <summary>
    /// Give player enough time to leave the elevator before the gate closes behind them.
    /// </summary>
    /// <param name="otherObject"></param>
    /// <returns></returns>
    private IEnumerator WaitToCloseGate(GameObject otherObject)
    {
        // Open the gate.
        gateAnimator.SetTrigger("Open");
        gateAnimator.GetComponent <AudioSource>().Play();

        // Activate the SOS task.
        SOSTaskSequence.SetActive(true);

        if (PressedButton != null)
        {
            PressedButton.Invoke();
        }

        // HACK. Robert - I may have made a bad decision when I added the argument at the very end of InteractWithSelectedObject.cs.
        // I passed the GameObject's root, rather than the GameObject itself. I feel like I can only explain the consequences of this decision in person, however.
        // For now, suffice to say that this line works, it will likely always work, but it is a hack all the same.
        GameObject.FindGameObjectWithTag("Player").transform.SetParent(null);

        // Deactivate the elevator gate collider.
        elevatorGate.SetActive(false);

        // Give the player the opportunity to leave.
        yield return(new WaitForSeconds(waitTime));

        // Activate the gate collider again.
        elevatorGate.SetActive(true);

        // Close the gate.
        gateAnimator.SetTrigger("Close");
        gateAnimator.GetComponent <AudioSource>().Play();
    }
コード例 #2
0
 private void OnButtonRelease(PointerEventData eventData)
 {
     if (eventData.pointerPressRaycast.gameObject == buttonsDictionary[current].gameObject)
     {
         PressedButton?.Invoke(UI.PressedButton.None);
     }
 }
コード例 #3
0
    public void Interact(GameObject interactingAgent)
    {
        PlaySound();
        TurnOffEmission();
        DisableSOSCanvas();
        DisableCollision();

        if (PressedButton != null)
        {
            PressedButton.Invoke();
        }
    }
コード例 #4
0
 private void OnButtonPressed(PointerEventData eventData)
 {
     current = buttonsDictionary.Single(x => x.Value.gameObject == eventData.pointerPressRaycast.gameObject).Key;
     PressedButton?.Invoke(current);
 }
コード例 #5
0
 public void OnPressedButton()
 {
     clubManager.StartByGuest(RoomName);
     PressedButton?.Invoke(this, EventArgs.Empty);
 }