GetNextSpeech() public method

public GetNextSpeech ( ) : void
return void
Ejemplo n.º 1
0
    public void SideKickPerformAction()
    {
        if (_playerInteract != null)
        {
            switch (ActionToPerform)
            {
            case 0:
                _playerInteract.ChangePlayerInteractState(true);
                speech.GetNextSpeech();
                break;

            default:
                Debug.Log("None");
                break;
            }
        }
    }
Ejemplo n.º 2
0
    IEnumerator ExecuteWaypoint()
    {
        //float endTime = 0f;

        yield return(new WaitForSeconds(0.5f));

        while (sidekick.GetComponent <NavMeshAgent>().HasReachedTarget() == false)
        {
            yield return(new WaitForSeconds(0.1f));
        }

        //  sidekick.GetComponent<NavMeshAgent>().ResetPath();

        //   sidekick.GetComponent<NavMeshAgent>().updateRotation = false;

        if (GameObjectToLookAt != null)
        {
            sidekick.GetComponent <CharacterAnimMovement>().StartAdjustPosition(GameObjectToLookAt);
        }

        if (UseObstacle)
        {
            if (ObstacleInTheWay)
            {
                obstacle.GetComponent <NavMeshObstacle>().enabled = true;
            }
            else
            {
                obstacle.GetComponent <NavMeshObstacle>().enabled = false;
            }
        }

        if (InteractWithLever)
        {
            sidekick.GetComponent <SidekickControls>().ExecuteAction(2);
        }

        if (MakeSomthingBlink && ObjectThatShouldBlink != null)
        {
            ObjectThatShouldBlink.AddComponent <BlinkingObject>();
        }

        if (MakeSomthingStopBlink && ObjectThatShouldStopBlink != null && ObjectThatShouldStopBlink.GetComponent <BlinkingObject>() != null)
        {
            ObjectThatShouldStopBlink.GetComponent <BlinkingObject>().Stop();
        }


        if (Animate)
        {
            sidekick.GetComponent <Animator>().SetTrigger(Animation);
            yield return(new WaitForFixedUpdate());
            //endTime = sidekick.GetComponent<Animator>().get
        }

        if (UseSignBubble)
        {
            speech.ActivateSidekickSignBubble(DisplaySignId);
        }

        if (WaitForInteraction)
        {
            while (!Interactable.GetComponent <IInteractable>().HasBeenActivated())
            {
                yield return(new WaitForSeconds(0.2f));
            }
        }

        while (UseText && AdvanceSpeechByNSteps > 0)
        {
            speech.GetNextSpeech();
            AdvanceSpeechByNSteps--;
            yield return(new WaitForSeconds(TimePerStep));
        }

        if (AddNewSign)
        {
            GameObject.FindGameObjectWithTag(Constants.Tags.GameUI).GetComponent <UiController>().NewSignCreation(SignId);
        }

        if (WaitForPlayer)
        {
            while (Vector3.Distance(player.transform.position, sidekick.transform.position) > WaitForPlayerDistance)
            {
                yield return(new WaitForSeconds(0.1f));
            }
        }

        if (WaitForPlayerMovement)
        {
            var startPos = player.transform.position;
            var agent    = player.GetComponent <AiMovement>();

            while (!(Vector3.Distance(startPos, player.transform.position) > 0.5 && agent.GetCurrentState().GetType() == typeof(ExploreState)))
            {
                yield return(new WaitForSeconds(0.1f));
            }
        }

        if (WaitForCamMovement)
        {
            CameraManager.HaveMovedCamera = false;
            while (!CameraManager.HaveMovedCamera)
            {
                yield return(new WaitForSeconds(0.1f));
            }
        }

        if (WaitForCamRotate)
        {
            CameraManager.HaveRotatedCameraClock        = false;
            CameraManager.HaveRotatedCameraCounterClock = false;
            while (!(CameraManager.HaveRotatedCameraClock && CameraManager.HaveRotatedCameraCounterClock))
            {
                yield return(new WaitForSeconds(0.1f));
            }
        }

        if (WaitForCamZoom)
        {
            CameraManager.HaveZoomedCamera = false;
            while (!CameraManager.HaveZoomedCamera)
            {
                yield return(new WaitForSeconds(0.1f));
            }
        }

        if (WaitForitemBeeingPickedUp)
        {
            while (PickUp.activeSelf)
            {
                yield return(new WaitForSeconds(0.1f));
            }
        }


        yield return(!sidekick.GetComponent <Animator>().GetCurrentAnimatorStateInfo(0).IsName("Base." + Animation));

        if (WaitForSeconds)
        {
            yield return(new WaitForSeconds(WaitTime));
        }


        // sidekick.GetComponent<NavMeshAgent>().updateRotation = true;

        if (WaitForPlayerSpeek)
        {
            var bubble = FindObjectOfType <InteractableSpeechBubble>();
            while (bubble.CurrentPlayerSignId != PlayerSpeekId)
            {
                yield return(new WaitForSeconds(0.1f));
            }
            speech.GetNextSpeech();
            sidekick.GetComponent <SidekickControls>().ExecuteAction(PlayerSpeekId);
        }


        if (SetFakeInteractable)
        {
            GameObject.FindObjectOfType <FakeInteracable>().Activated = true;
        }


        sidekick.GetComponent <WaypointSystem>().NextWaypoint();
    }