Example #1
0
    void PlayNextScript()
    {
        if (_enumerator.MoveNext())
        {
            TutorialScript script = _enumerator.Current.Value;
            _guideText.text = script.text;

            if (!script.eventName.Equals("empty"))
            {
                _curEventName = script.eventName;
                _eventState   = eEventState.START;

                if (_curEventName == "build_tile")
                {
                    GameManager.Instance._playerInput.OnEditMode();
                }
                else if (_curEventName == "remove_fog")
                {
                    GameManager.Instance._playerInput.OnCameraMode();
                }
            }
        }
        else
        {
            EndTutorial();
        }
    }
Example #2
0
    public void ReSet()
    {
        curState = eEventState.END;
        restTime = 0;

        for (int i = 0; i < eventCount; ++i)
        {
            Events[i].ReSet();
        }
    }
Example #3
0
    public void Init()
    {
        if (isInit)
        {
            return;
        }

        isInit    = true;
        scoreText = GameObject.Find("ScoreText").GetComponent <Text>();

        curEvent = eEventState.REST;
    }
Example #4
0
    void Start()
    {
        _isPlaying = true;
        GameManager.Instance._isPlayingTutorial = _isPlaying;
        _eventState = eEventState.NONE;
        _enumerator = ResourceManager.Instance.GetScriptMap().GetEnumerator();

        _skipButton.onClick.AddListener(EndTutorial);

        //이벤트 관련 변수 초기화
        InitEvent();

        PlayNextScript();
    }
Example #5
0
    void ReStart()
    {
        Events[curEvent].EventEnd();
        Events[curEvent].curState = Event.ePlayEventState.PLAYEND;

        curEvent = Random.Range(0, eventCount);
        while (eventCount != 1)
        {
            if (curEvent != prevEvent)
            {
                break;
            }
            curEvent = Random.Range(0, eventCount);
        }

        Events[curEvent].Reset();
        curState          = eEventState.PLAY;
        scoreMgr.curEvent = ScoreManager.eEventState.START;
        prevEvent         = curEvent;
    }
Example #6
0
    public void EventUpdate()
    {
        switch (curEvent)
        {
        case eEventState.START:
            isPlayerCol = false;
            break;

        case eEventState.COL:
            isPlayerCol = true;
            break;

        case eEventState.END:
            if (!isPlayerCol)
            {
                score += 200;
            }
            curEvent = eEventState.REST;
            break;
        }
    }
Example #7
0
    public void Update()
    {
        switch (curState)
        {
        case eEventState.PLAY:
            if (Events[curEvent].curState == Event.ePlayEventState.PLAYEND)
            {
                curState          = eEventState.END;
                scoreMgr.curEvent = ScoreManager.eEventState.END;
            }
            break;

        case eEventState.END:
            restTime += Time.deltaTime;
            if (restTime >= restInterval)
            {
                restTime = 0.0f;

                ReStart();
            }
            break;
        }
    }
Example #8
0
    void Update()
    {
        if (!_isPlaying)
        {
            return;
        }

        if (eEventState.NONE == _eventState && Input.GetMouseButtonDown(0))
        {
            PlayNextScript();
        }
        else if (eEventState.START == _eventState && Input.GetMouseButtonDown(0))
        {
            //튜토리얼 텍스트 창을 닫고 퀘스트를 시작한다.
            _guideBox.SetActive(false);
            _blockPanel.SetActive(false);
            _eventState = eEventState.PLAYING;
        }
        else if (eEventState.PLAYING == _eventState)
        {
            if (CheckEventState(_curEventName))
            {
                _eventState   = eEventState.DONE;
                _curEventName = "empty";
            }
        }
        else if (eEventState.DONE == _eventState)
        {
            //퀘스트가 완료되면 가이드 박스를 활성화 시켜준다.
            _guideBox.SetActive(true);
            _blockPanel.SetActive(true);
            _eventState = eEventState.NONE;

            PlayNextScript();
        }
    }