TimeBattleScene.cs 1013 B

123456789101112131415161718192021222324252627282930313233
  1. using UnityEngine;
  2. using System.Collections;
  3. public class TimeBattleScene : BaseBattleScene
  4. {
  5. public TimeBattleScene(TimeBattle battle,string sceneName):
  6. base(battle,sceneName)
  7. {
  8. }
  9. public override void OnSceneLoaded()
  10. {
  11. GameObject[] rootObjs = mScene.GetRootGameObjects();
  12. ReadyPoint actorBornPoint = null;
  13. SpawnPoint enemyBornPoint = null;
  14. GameObject spawnPoint = rootObjs.FindFirst(a => a.name.CompareTo(Constants.actor_born_point) == 0);
  15. if (spawnPoint != null)
  16. {
  17. actorBornPoint = spawnPoint.GetComponent<ReadyPoint>();
  18. }
  19. spawnPoint = rootObjs.FindFirst(a => a.name.CompareTo(Constants.enemy_actor_born_point) == 0);
  20. if (spawnPoint != null)
  21. {
  22. enemyBornPoint = spawnPoint.GetComponent<SpawnPoint>();
  23. enemyBornPoint.SavePoint();
  24. }
  25. TimeBattle battle = mBattle as TimeBattle;
  26. battle.SetReadyPoint(actorBornPoint, enemyBornPoint);
  27. }
  28. }