SceneRaingearForest.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. //================================================================================
  2. //
  3. //================================================================================
  4. using UnityEngine;
  5. using System.Collections;
  6. //================================================================================
  7. //
  8. //================================================================================
  9. namespace ReaderRabbit
  10. {
  11. //================================================================================
  12. //
  13. //================================================================================
  14. public class SceneRaingearForest : SceneCommon
  15. {
  16. //================================================================================
  17. //
  18. //================================================================================
  19. private enum Characters
  20. {
  21. Reader = CharactersCommon.Reader,
  22. Sam = CharactersCommon.Sam,
  23. Paige = CharactersCommon.Paige,
  24. Chester = CharactersCommon.Chester,
  25. }
  26. //================================================================================
  27. //
  28. //================================================================================
  29. private const int MAX_READER_INDEX = 2;
  30. private int m_ReaderClickCount;
  31. //================================================================================
  32. //
  33. //================================================================================
  34. protected override void Start()
  35. {
  36. base.Start();
  37. //============================================================================
  38. //
  39. //============================================================================
  40. int lang = PlayerPrefs.GetInt("language");
  41. if (lang == 0)
  42. m_SpeechFolder = "Resources_DA/Audio/RaingearForest_Speech";
  43. else if (lang == 1)
  44. m_SpeechFolder = "Resources_EN/Audio/RaingearForest_Speech";
  45. else if (lang == 2)
  46. m_SpeechFolder = "Resources_NO/Audio/RaingearForest_Speech";
  47. else if (lang == 3)
  48. m_SpeechFolder = "Resources_SP/Audio/RaingearForest_Speech";
  49. else if (lang == 4)
  50. m_SpeechFolder = "Resources_SW/Audio/RaingearForest_Speech";
  51. //============================================================================
  52. //
  53. //============================================================================
  54. PlayerData.Instance().SetVisitedRaingearForest(true);
  55. PlayerData.Instance().SetCurrentLocation(Location.RaingearForest);
  56. AudioManager.Instance().PlayBGM("BGM_RaingearForest");
  57. m_ReaderClickCount = 0;
  58. }
  59. //================================================================================
  60. //
  61. //================================================================================
  62. protected override void PlayFirstEvent()
  63. {
  64. if (m_IsFirstTime)
  65. {
  66. NewSequence();
  67. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "22150");
  68. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "22151");
  69. SetSequence(2, EventSequenceItem.EventSequenceType.Callback, DoneFirstTime);
  70. StartSequence(3);
  71. }
  72. }
  73. //================================================================================
  74. //
  75. //================================================================================
  76. public override void SpeechReader()
  77. {
  78. ++m_ReaderClickCount;
  79. if (m_ReaderClickCount > MAX_READER_INDEX)
  80. m_ReaderClickCount = 0;
  81. NewSequence();
  82. if (m_ReaderClickCount == 0)
  83. {
  84. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "22350");
  85. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "22351");
  86. StartSequence(2);
  87. }
  88. else
  89. {
  90. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "22352");
  91. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "22353");
  92. StartSequence(2);
  93. }
  94. }
  95. //================================================================================
  96. //
  97. //================================================================================
  98. public override void SpeechPaige()
  99. {
  100. NewSequence();
  101. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Paige, "22300");
  102. StartSequence(1);
  103. }
  104. } // public class SceneRaingearForest : SceneCommon
  105. } // namespace ReaderRabbit