//================================================================================ // //================================================================================ using UnityEngine; using System.Collections; //================================================================================ // //================================================================================ namespace ReaderRabbit { //================================================================================ // //================================================================================ public class SceneRaingearIslandRainbow : SceneCommon { //================================================================================ // //================================================================================ [SerializeField] private RainbowAnimation m_RainbowAnimation; //================================================================================ // //================================================================================ protected override void Start() { base.Start(); //============================================================================ // //============================================================================ int lang = PlayerPrefs.GetInt("language"); if (lang == 0) m_SpeechFolder = "Resources_DA/Audio/RaingearIslandRainbow_Speech"; else if (lang == 1) m_SpeechFolder = "Resources_EN/Audio/RaingearIslandRainbow_Speech"; else if (lang == 2) m_SpeechFolder = "Resources_NO/Audio/RaingearIslandRainbow_Speech"; else if (lang == 3) m_SpeechFolder = "Resources_SP/Audio/RaingearIslandRainbow_Speech"; else if (lang == 4) m_SpeechFolder = "Resources_SW/Audio/RaingearIslandRainbow_Speech"; //============================================================================ // //============================================================================ m_RainbowAnimation.SetOnAnimatorFinishedCallback(GotoNavigation); } //================================================================================ // //================================================================================ protected override void PlayFirstEvent() { if (PlayerData.Instance().RGIR_Direction == 1) // Going up the rainbow. { m_RainbowAnimation.TriggerAnimation(true); } else if (PlayerData.Instance().RGIR_Direction == 2) // Going down the rainbow. { m_RainbowAnimation.TriggerAnimation(false); } } //================================================================================ // //================================================================================ void GotoNavigation() { string navigation = ""; if (PlayerData.Instance().RGIR_Direction == 1) // Going up the rainbow. { navigation = "DowntownCloudNine"; } else if (PlayerData.Instance().RGIR_Direction == 2) // Going down the rainbow. { navigation = "RockHead"; } if (!string.IsNullOrEmpty(navigation)) { PlayerData.Instance().RGIR_Direction = 0; KishiTechUnity.Loading.Loading.Instance().Show(); SetCurrentToNavigation(navigation); OnNavigation(); } } } // public class SceneRaingearIslandRainbow : SceneCommon } // namespace ReaderRabbit