Beispiel #1
0
    IEnumerator NextStep()
    {
        // Remember, _currentStep here is what JUST GOT FINISHED.
        switch (_currentStep)
        {
        case Step.InBetween:
            // TODO Bring subject in
            GenerateSubject();
            uiCont.ShowDialogue("Yo draw my face dawggggggggg hehehehehehehehehehehhe");
            break;

        case Step.TakePhoto:
            yield return(_cam.GoToPosition(CameraController.CameraPos.Right));

            // TODO flash camera
            yield return(uiCont._FlashCamera());

            // TODO loading icon on screen
            StartCoroutine(_cam.GoToPosition(CameraController.CameraPos.Center));
            yield return(uiCont._StartLoading());

            // TODO show model on screen
            _subjDrawing.gameObject.SetActive(true);
            break;

        case Step.EditImage:
            StartCoroutine(_cam.GoToPosition(CameraController.CameraPos.Left));
            uiCont.ShowDialogue("Accuracy: " + (_subj.CalculateAccuracy(_subjDrawing) * 100f));
            // TODO print image out - somehow project model onto it??
            // maybe printer jams heh
            yield return(Print());

            yield return(_cam.GoToPosition(CameraController.CameraPos.Center));

            _paper.transform.localScale = Vector3.one;
            _paper.transform.position   = new Vector3(-3.5f, -9, -17);
            const float moveDur = 1.2f;
            yield return(_paper.transform.DOMoveY(-.3f, moveDur).WaitForCompletion());

            break;

        case Step.HandPrintedImage:
            // TODO hand printed photo to subject
            var         front   = _paper.transform.Find("front");
            var         back    = _paper.transform.Find("back");
            const float turnDur = .8f;
            yield return(front.DOScaleX(0, turnDur / 2).SetEase(Ease.Linear).WaitForCompletion());

            yield return(back.DOScaleX(1, turnDur / 2).WaitForCompletion());

            // TODO dismiss subject

            if (_subj.MakeChoiceAboutPrint(_subjDrawing))
            {
                yield return(uiCont._ShowDialogue("hey that's pretty good"));
            }
            else
            {
                yield return(uiCont._ShowDialogue("damn son what did you do to my face. 0/10"));
            }
            // TODO close the "file" on computer?
            ClearSubjects();
            GameObject.Destroy(_paper);
            break;
        }

        _currentStep = (Step)(((int)_currentStep + 1) % Enum.GetValues(typeof(Step)).Length);

        yield return(null);
    }