예제 #1
0
    public void LoadNextLevel()
    {
        EndLevel();

        if (m_currentMapIdx < MapList.Count - 1)
        {
            ++m_currentMapIdx;
        }
        else
        {
            DialogsController.GetInstance().ShowDialog(DialogType.MapSelectorMenu);
            return;
        }

        var mapPahs = MapList.GetMapPaths(m_currentMapIdx);

        if (mapPahs == null)
        {
            return;
        }

        ResetTempMapData();
        MapInfo map_info = (mapPahs.GetMapPrefab()).GetComponent <MapInfo>();

        map_info.m_mapName = mapPahs.Name;
        map_info.m_mapIcon = mapPahs.GetMapIcon();
        GameProgress.SetMap(m_currentMapIdx, false);

        DialogsController.GetInstance().ShowMapDescriptionMenu(m_currentMapIdx);
    }
예제 #2
0
 private void OnDestroy()
 {
     if (m_instance == this)
     {
         m_instance = null;
     }
 }
예제 #3
0
    public void OnButtonEndLevelPressed()
    {
        WorldControl.GetInstance().EndLevel();

        DialogsController.GetInstance().ShowDialog(DialogType.StartMenu);
        SetActive(false);
    }
예제 #4
0
 private void Start()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     controller = GetComponent <DialogsController>();
     LoadDialogs();
 }
예제 #5
0
    private void Awake()
    {
        if (m_instance != null)
        {
            Debug.Assert(m_instance == this, "Second DialogsController insance");
            return;
        }

        m_instance = this;
    }
예제 #6
0
    public void ShowBook(DialogsController dialogController)
    {
        this.dialogController = dialogController;
        gameObject.SetActive(true);

        book = gameObject.transform.Find("Book").gameObject;
        book.GetComponent <Fader>().fadeObjectWithChilds(FadeDirection.In, closingAnimationTime);

        animator = book.GetComponent <Animator>();
        //animator.Play("BookOpen");
    }
예제 #7
0
    public void SetPause(bool isPause)
    {
        m_isPaused     = isPause;
        Time.timeScale = isPause? 0.0f : m_gameSpeed;

        if (IsInGame)
        {
            if (isPause)
            {
                DialogsController.GetInstance().ShowDialog(DialogType.PauseMenu);
            }
            else
            {
                DialogsController.GetInstance().CloseAllDialogs();
            }
        }
    }
예제 #8
0
 public void OnButtonSelectLevelPressed()
 {
     DialogsController.GetInstance().ShowDialog(DialogType.MapSelectorMenu);
     SetActive(false);
 }
예제 #9
0
 public void OnButtonBackPressed()
 {
     DialogsController.GetInstance().ShowDialog(DialogType.StartMenu);
     SetActive(false);
 }
예제 #10
0
 private void OnMapSelected(int mapIdx)
 {
     DialogsController.GetInstance().ShowMapDescriptionMenu(mapIdx);
     SetActive(false);
 }