예제 #1
0
파일: Actor.cs 프로젝트: p-brighenti/ld47
    void Start()
    {
        textPlayer     = GetComponent <TextAnimatorPlayer>();
        levelValidator = GameObject.FindObjectOfType <LevelValidator>();

        if (inDialogueMode)
        {
            dialogueByLine = dialogue.Split('\n');
            return;
        }

        speechByLine = speech.Split('\n');
        ShowNamePlate();
    }
예제 #2
0
        void FindTextAnimator()
        {
            Transform targetTrans = this.transform;

            _dialogueCanvas  = GameObject.FindGameObjectWithTag("Dialogue");
            _audioSource     = _dialogueCanvas.GetComponentInChildren <AudioSource>();
            _dialogueHistory = _dialogueCanvas.GetComponentInChildren <DialogueHistory>();

            //Looks for the GameObject with the DialogueController.cs attached (First part of acquiring the TextAnimator and TextAnimatorPlayer)
            foreach (Transform child in _dialogueCanvas.transform)
            {
                if (child.GetComponent <DialogueController>())
                {
                    //Gets the child of the GameObject that has the DialogueController.cs attached to it
                    targetTrans = child.transform.GetChild(0);
                }
            }

            //Second part of acquiring the TextAnimator and TextAnimatorPlayer
            if (targetTrans != null)
            {
                //Looks for the GameObject with the TextAnimator and TextAnimatorPlayer attached
                foreach (Transform child2 in targetTrans)
                {
                    if (child2.GetComponent <TextAnimator>())
                    {
                        _textAnimator = child2.GetComponent <TextAnimator>();
                    }

                    if (child2.GetComponent <TextAnimatorPlayer>())
                    {
                        _textAnimatorPlayer = child2.GetComponent <TextAnimatorPlayer>();
                    }
                }

                if (_textAnimatorPlayer != null)
                {
                    _textAnimator.timeScale = TextAnimator.TimeScale.Scaled;
                }
            }
        }
예제 #3
0
 private void Start()
 {
     textAnimatorPlayer = GetComponent <TextAnimatorPlayer>();
 }
예제 #4
0
 private void Awake()
 {
     textAnimator = GetComponent <TextAnimatorPlayer>();
     PlayText();
 }