public void Start() { _guiCanvas = GuiCanvas.Instance; _talkingUi = _guiCanvas.TalkingUi; QMark = transform.FindChild("?").gameObject; QMark.SetActive(false); Lines = TextLoader.Instance.GetLinesById(TextId); }
public void Start() { _guiCanvas = GuiCanvas.Instance; _talkingUi = _guiCanvas.TalkingUi; _animator = GetComponentInChildren<Animator>(); _birdProps = BirdPropsService.Instance.GetBirdPropsById(TextId); if (_birdProps != null) { if (_birdProps.AnimatorController != null) { _animator.runtimeAnimatorController = _birdProps.AnimatorController; } _animator.CrossFade(_birdProps.DefaultAnim, 0f); } else { _birdProps = new BirdProps("Idle", true, null); } QMark = transform.FindChild("?").gameObject; QMark.SetActive(false); Directions = DirectionService.Instance.GetDirectionsById(TextId); _animator.CrossFade(_birdProps.DefaultAnim, 0f); _animator.transform.localScale = _animator.transform.localScale.SetX(_birdProps.FaceLeft ? 1 : -1); if (State.Instance.LevelEntrance == LevelEntrance.BeachRival && TextId == "Rival") { var lossDialog = new List<Direction> { new Line("Winson \"Collecto\"", "Woof. Erm, Chirp. Not the best dancing I've seen."), new Line("Winson \"Collecto\"", "We can go again any time. You may need to practice.") }; var perfectDialog = new List<Direction> { new Line("Winson \"Collecto\"", "Wow. Just wow. I am very impressed."), new Line("Winson \"Collecto\"", "So, about your prize. It's the most prized and valuable thing to my name."), new Line("Winson \"Collecto\"", "It's... my respect. You have my respect. Good job guy."), new Line("Winson \"Collecto\"", "We can go again any time.") }; var okDialog = new List<Direction> { new Line("Winson \"Collecto\"", "Pretty good. Not perfect, but pretty good."), new Line("Winson \"Collecto\"", "You're an ok bird."), new Line("Winson \"Collecto\"", "We can go again any time, if you'd like.") }; Directions = new List<Direction> { new Line("Winson \"Collecto\"", "Wow. Just wow. I am very impressed."), new Line("Winson \"Collecto\"", "So, about your prize. It's the most prized and valuable thing to my name."), new Line("Winson \"Collecto\"", "It's... my respect. You have my respect. Good job guy."), new Line("Winson \"Collecto\"", "We can go again any time.") }; if (State.Instance.FailedBeats <= 5 && State.Instance.FailedBeats > 2) { Directions = okDialog; } else if (State.Instance.FailedBeats <= 2) { Directions = perfectDialog; } else { Directions = lossDialog; } _animator.CrossFade("Talk", 0f); StartCoroutine(StartSequence(() => { Directions = DirectionService.Instance.GetDirectionsById(TextId); FindObjectOfType<Control>().Disabled = false; _animator.CrossFade("Idle", 0f); })); } }