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(); } }
public void ReSet() { curState = eEventState.END; restTime = 0; for (int i = 0; i < eventCount; ++i) { Events[i].ReSet(); } }
public void Init() { if (isInit) { return; } isInit = true; scoreText = GameObject.Find("ScoreText").GetComponent <Text>(); curEvent = eEventState.REST; }
void Start() { _isPlaying = true; GameManager.Instance._isPlayingTutorial = _isPlaying; _eventState = eEventState.NONE; _enumerator = ResourceManager.Instance.GetScriptMap().GetEnumerator(); _skipButton.onClick.AddListener(EndTutorial); //이벤트 관련 변수 초기화 InitEvent(); PlayNextScript(); }
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; }
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; } }
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; } }
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(); } }