예제 #1
0
    //private bool localPlayerInput;			// True if local player input this frame

    // Update is called once per frame
    void Update()
    {
        if (!isLocalPlayer)
        {
            return;
        }

        // Check for touch or keyboard input
        if (TouchInput() || Input.GetKeyDown(KeyCode.Space))
        {
            int reactionTime = DuelManager.Get().GetCurrentTime();
            CmdTriggerReaction(isServer, reactionTime);
        }
    }
예제 #2
0
    private bool inputReceived;                                 // True if input has been received this round during gameplay

    #endregion


    #region Photon Behaviour API

    void Update()
    {
        // Stop if not the local player or input has been received
        if (!ShouldCheckForInput())
        {
            return;
        }

        // Check for touch or keyboard input
        if (TouchInput() || Input.GetKeyDown(KeyCode.Space))
        {
            inputReceived = true;

            // Trigger player reaction at the current time
            int reactionTime = DuelManager.Get().GetCurrentTime();
            TriggerReaction(isHost, reactionTime);
        }
    }
예제 #3
0
    // Update is called once per frame
    void Update()
    {
        // Get input status
        CheckInput();

        // Submit reaction inputs from either player
        if (manager.WaitingForInput())
        {
            int reactionTime = DuelManager.Get().GetCurrentTime();
            if (leftPlayerInput)
            {
                manager.TriggerReaction(true, reactionTime);
            }
            if (rightPlayerInput)
            {
                manager.TriggerReaction(false, reactionTime);
            }
        }
    }
예제 #4
0
 private void RpcTriggerReaction(bool hostSamurai, int reactionTime)
 {
     DuelManager.Get().TriggerReaction(hostSamurai, reactionTime);
 }