Exemplo n.º 1
0
    public void Interact()
    {
        if (_currentThrowable != null)
        {
            ((MonoBehaviour)_currentThrowable).transform.parent = null;
            _currentThrowable.Throw(cameraObject.forward);
            _currentThrowable = null;
            return;
        }

        RaycastHit hit;

        if (!Physics.Raycast(cameraObject.position, cameraObject.forward, out hit, maxRayDistance, interactibleLayer))
        {
            return;
        }

        GameObject        obj = hit.collider.gameObject;
        InteractiveObject otherInteractive = obj.GetComponent <InteractiveObject>();

        if (otherInteractive == null || !otherInteractive.IsCanInteract())
        {
            return;
        }

        IThrowable throwable = otherInteractive as IThrowable;

        if (throwable != null)
        {
            var sim = obj.GetComponent <SimulatedEntityBase>();
            if (sim == null && simController.GetCurrentMode() != PlaybackMode.PlayAndRecord)
            {
                return;
            }

            throwable.Take();
            otherInteractive.transform.parent        = throwableObjectAttachTransform;
            otherInteractive.transform.localPosition = Vector3.zero;
            _currentThrowable = throwable;
            return;
        }

        otherInteractive.TryDoInteract();
    }
Exemplo n.º 2
0
    private void Update()
    {
        PlaybackMode mode = simulationController.GetCurrentMode();

        if (mode == PlaybackMode.Pause)
        {
            videoPlayer.enabled       = true;
            glitchEffect.enabled      = true;
            videoPlayer.playbackSpeed = 0;
        }
        else if (mode == PlaybackMode.Rewind || mode == PlaybackMode.FastForward)
        {
            videoPlayer.enabled       = true;
            glitchEffect.enabled      = true;
            videoPlayer.playbackSpeed = 10;
        }
        else
        {
            videoPlayer.enabled  = false;
            glitchEffect.enabled = false;
        }
    }
Exemplo n.º 3
0
 void Update()
 {
     _animator.SetInteger("playBackState", (int)_simulationController.GetCurrentMode());
     _animator.SetBool("isFast", _simulationController.IsFastPlayBack());
 }