//================================================================================ // //================================================================================ using UnityEngine; using System.Collections; //================================================================================ // //================================================================================ namespace ReaderRabbit { //================================================================================ // //================================================================================ public class SceneRaingearForest : SceneCommon { //================================================================================ // //================================================================================ private enum Characters { Reader = CharactersCommon.Reader, Sam = CharactersCommon.Sam, Paige = CharactersCommon.Paige, Chester = CharactersCommon.Chester, } //================================================================================ // //================================================================================ private const int MAX_READER_INDEX = 2; private int m_ReaderClickCount; //================================================================================ // //================================================================================ protected override void Start() { base.Start(); //============================================================================ // //============================================================================ int lang = PlayerPrefs.GetInt("language"); if (lang == 0) m_SpeechFolder = "Resources_DA/Audio/RaingearForest_Speech"; else if (lang == 1) m_SpeechFolder = "Resources_EN/Audio/RaingearForest_Speech"; else if (lang == 2) m_SpeechFolder = "Resources_NO/Audio/RaingearForest_Speech"; else if (lang == 3) m_SpeechFolder = "Resources_SP/Audio/RaingearForest_Speech"; else if (lang == 4) m_SpeechFolder = "Resources_SW/Audio/RaingearForest_Speech"; //============================================================================ // //============================================================================ PlayerData.Instance().SetVisitedRaingearForest(true); PlayerData.Instance().SetCurrentLocation(Location.RaingearForest); AudioManager.Instance().PlayBGM("BGM_RaingearForest"); m_ReaderClickCount = 0; } //================================================================================ // //================================================================================ protected override void PlayFirstEvent() { if (m_IsFirstTime) { NewSequence(); SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "22150"); SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "22151"); SetSequence(2, EventSequenceItem.EventSequenceType.Callback, DoneFirstTime); StartSequence(3); } } //================================================================================ // //================================================================================ public override void SpeechReader() { ++m_ReaderClickCount; if (m_ReaderClickCount > MAX_READER_INDEX) m_ReaderClickCount = 0; NewSequence(); if (m_ReaderClickCount == 0) { SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "22350"); SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "22351"); StartSequence(2); } else { SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "22352"); SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "22353"); StartSequence(2); } } //================================================================================ // //================================================================================ public override void SpeechPaige() { NewSequence(); SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Paige, "22300"); StartSequence(1); } } // public class SceneRaingearForest : SceneCommon } // namespace ReaderRabbit