Exemplo n.º 1
0
    private IEnumerator NewRoutine()
    {
        BlackPanel.Get().Show();

        yield return(new WaitForSeconds(1f));

        PlayerData.NewGame();
        SceneNav.GoTo(PlayerData.Get().current_scene);
    }
Exemplo n.º 2
0
    private IEnumerator LoadRoutine()
    {
        BlackPanel.Get().Show();

        yield return(new WaitForSeconds(1f));

        PlayerData.Unload(); //Make sure to unload first, or it won't load if already loaded
        PlayerData.LoadLast();
        SceneNav.GoTo(PlayerData.Get().current_scene);
    }
Exemplo n.º 3
0
    void HideBlackLoaderPanel()
    {
        //print ("HideBlackLoaderPanel ------------------------------------");

        _stage.HideLoader();

        DestroyImmediate(_blackPanel.gameObject);

        _blackPanel = null;
    }
Exemplo n.º 4
0
 private void Start()
 {
     if (mode == WorldGeneratorMode.Runtime && Application.isPlaying)
     {
         TheGame.Get().PauseScripts();
         BlackPanel.Get().Show(true);
         GeneratedOrLoadWorld();
         BlackPanel.Get().Hide();
         TheGame.Get().UnpauseScripts();
     }
 }
Exemplo n.º 5
0
    IEnumerator ShowBlackLoaderPanel(string message = "Checking Challenge...")
    {
        GameObject subScreen = (GameObject)Instantiate(Resources.Load("HomeScreen/BlackPanel"));

        yield return(subScreen);

        _blackPanel = subScreen.GetComponent <BlackPanel> ();
        _blackPanel.GetComponent <CanvasGroup> ().alpha = 0;
        _blackPanel.gameObject.transform.SetParent(_stage.transform, false);
        _blackPanel.GetComponent <FadeMe>().startFadeIn(0.85f);

        _blackPanel.GetComponentInChildren <Text> ().text = message;

        LeanTween.delayedCall(0.1f, _stage.ShowLoader);
    }
Exemplo n.º 6
0
    private void Start()
    {
        //Load game data
        PlayerData pdata = PlayerData.Get();
        GameData   gdata = GameData.Get();

        if (!string.IsNullOrEmpty(pdata.current_scene))
        {
            if (pdata.current_entry_index < 0 && pdata.current_scene == SceneNav.GetCurrentScene())
            {
                PlayerCharacter.Get().transform.position = pdata.current_pos;
                TheCamera.Get().MoveToTarget(pdata.current_pos);
            }
        }

        pdata.current_scene = SceneNav.GetCurrentScene();

        //Spawn dropped items
        foreach (KeyValuePair <string, DroppedItemData> elem in pdata.dropped_items)
        {
            if (elem.Value.scene == SceneNav.GetCurrentScene())
            {
                Item.Spawn(elem.Key);
            }
        }

        //Spawn constructions
        foreach (KeyValuePair <string, BuiltConstructionData> elem in pdata.built_constructions)
        {
            if (elem.Value.scene == SceneNav.GetCurrentScene())
            {
                Construction.Spawn(elem.Key);
            }
        }

        //Spawn plants
        foreach (KeyValuePair <string, SowedPlantData> elem in pdata.sowed_plants)
        {
            if (elem.Value.scene == SceneNav.GetCurrentScene())
            {
                Plant.Spawn(elem.Key);
            }
        }

        BlackPanel.Get().Show(true);
        BlackPanel.Get().Hide();
    }
Exemplo n.º 7
0
 protected override void Awake()
 {
     base.Awake();
     _instance = this;
 }