Exemplo n.º 1
0
    private void MineLoad()
    {
        if (GameManager.previousSceneIndex != 0) // if we load not from main menu
        {
            return;
        }

        Debug.Log("Load mine");

        _chancesGenerator.LoadChances(LoadSystem.Load <ChancesData>("chances"));

        generateLevel.LoadLevelPrefab(LoadSystem.Load <LevelPrefabData>("level").seed);

        PlayerPositionData playerPositionData =
            LoadSystem.Load <PlayerPositionData>("player");

        if (playerPositionData != null)
        {
            playerGO.transform.position = new Vector3(playerPositionData.position[0],
                                                      playerPositionData.position[1],
                                                      playerPositionData.position[2]);
        }

        _gridBehavior.LoadGrid(LoadSystem.Load <GridData>("grid"));

        oreGenerator.LoadOres(LoadSystem.Load <OresData>("ores"));


        _nextLevelLoadController.LoadDescent(LoadSystem.Load <DescentData>("descent"));

        progressBar.LoadProgressBar(LoadSystem.Load <ProgressBarData>("progressBar"));

        SaveBaseOnCurrentScene();
    }
Exemplo n.º 2
0
    private void CityLoad()
    {
        Debug.Log("Load city");

        _pickaxesUpgradeController.LoadIndexes(LoadSystem.Load <PickaxesUpgradeData>("shopIndexes"));
        MoneyUpgradesController.LoadData(LoadSystem.Load <BankData>("bank"));
    }
Exemplo n.º 3
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(instance);
        }

        equipos       = new List <Equipo>();
        equipoActual  = null;
        jugadorActual = null;

        resWidth  = Screen.width;
        resHeight = Screen.height;

        carpetasJugadas = new List <CarpetaJugada>();

        debugText.text = Application.persistentDataPath;

        pantallaCarga.gameObject.SetActive(true);

        LoadSystem.LoadData();

        MobileAds.Initialize(initStatus => {});

        DontDestroyOnLoad(this);
    }
Exemplo n.º 4
0
    private void CityLoad()
    {
        Debug.Log("Load city");

        _pickaxesUpgradeController.LoadIndexes(LoadSystem.Load <PickaxesUpgradeData>("shopIndexes"));
        MoneyUpgradesController.LoadData(LoadSystem.Load <BankData>("bank"));

        // we save city after player goes to city
        CitySave();
    }
Exemplo n.º 5
0
    public void LoadProcess()
    {
        SaveSystem.LoadPhysicalSkill();
        SaveSystem.LoadSkill();
        SaveSystem.LoadStat();


        LoadSystem.LoadPhysicalSkill();
        LoadSystem.LoadSkill();
        LoadSystem.LoadStat();
    }
        public void ContinuePressed()
        {
            var path = Application.persistentDataPath + "Player.data";

            if (!File.Exists(path))
            {
                return;
            }
            LoadSystem.Load();
            characterSetuper.SetupCharacter(ParameterManager.Instance.characterName);
            MoveToTheGameScene();
        }
Exemplo n.º 7
0
    private void GlobalLoad()
    {
        Debug.Log("Load global");

        extractedOresCounter.LoadOres(LoadSystem.Load <ExtractedOresData>("extractedOres"));

        SinglePlayerValues.LoadData(LoadSystem.Load <PlayerValuesData>("playerValues"));

        GameManager.LoadIndex(LoadSystem.Load <GameManagerData>("gameManager"));

        Statistics.LoadData(LoadSystem.Load <StatisticsData>("statistics"));

        AwakeningUpgradeController.LoadData(LoadSystem
                                            .Load <AwakeningUpgradeData>("awakeningUpgrades"));
    }
        private void Start()
        {
            AudioManager.Instance.Setup();
            var audioSettingsLoader = new AudioSettingsLoader("Audio.data");

            audioSettingsLoader.Load();
            audioSettingsLoader.DeleteSaves();

            var playerLoader = new PlayerLoader("Player.data");
            var mapLoader    = new MapLoader("Map.data");
            var botsLoader   = new BotsLoader("Bots.data");

            ParameterManager.Instance.SetDefaults();
            LoadSystem.AddLoader(playerLoader);
            LoadSystem.AddLoader(mapLoader);
            LoadSystem.AddLoader(botsLoader);
        }
    public Flower getFlower(Material mat)
    {
        GameObject obj = new GameObject(flowerName);

        obj.tag = "Flower";
        BoxCollider boxC = obj.AddComponent <BoxCollider>();

        obj.AddComponent <XRGrabInteractable>();
        Flower flower = obj.AddComponent <Flower>();

        flower.flowerName = flowerName;
        flower.userName   = userName;
        flower.position   = new Vector3(position[0], position[1], position[2]);
        flower.text       = text;
        for (int i = 0; i < partCount; i++)
        {
            string NName = flowerName + "." + i.ToString();
            flower.parts.Add(LoadSystem.LoadFlowerPart(NName, mat));
            flower.parts[i].transform.parent = obj.transform;
        }


        // Sets box collider to region contain all and only the flower part meshes
        // doesn't change the gameobject's position, so use collider information to set coordinates
        Bounds bounds = new Bounds(flower.parts[0].GetComponent <FlowerPart>().ml.bounds.center, Vector3.zero);// Vector3.zero, Vector3.zero);\

        for (int i = 0; i < partCount; i++)
        {
            bounds.Encapsulate(flower.parts[i].GetComponent <FlowerPart>().ml.bounds);
        }
        //Vector3 lowest = new Vector3(0, bounds.center[1]- bounds.size[1], 0);
        //bounds.center -= lowest;
        for (int i = 0; i < partCount; i++)
        {
            flower.parts[i].transform.Translate(-bounds.center);
        }
        boxC.size = bounds.size;
        //boxC.center = bounds.center;
        Rigidbody rigidBody = obj.GetComponent <Rigidbody>();

        rigidBody.freezeRotation = true;
        //rigidBody.useGravity = false;
        rigidBody.mass = 2.0f;
        return(flower);
    }
Exemplo n.º 10
0
    void FindLoad()
    {
//        LoadSystem.LoadPoint end = new LoadSystem.LoadPoint(2, 2);
//        LoadSystem.LoadPoint.endPoint = end;
//        LoadSystem.LoadPoint start = new LoadSystem.LoadPoint(4, 4);
//        LoadSystem.LoadPoint.startPoint = start;
//
//        List<LoadSystem.LoadPoint> map = new List<LoadSystem.LoadPoint>();
//        for (int i = 0; i < 7; i++)
//        {
//            for (int j = 0; j < 7; j++)
//            {
//                if((i<3 || i > 3) || j<2 || j> 5)
//                map.Add(new LoadSystem.LoadPoint(i, j));
//            }
//        }
//        LoadSystem loadSystem = new LoadSystem(start,end,map);


        Vector2        end   = new Vector2(18f, 18f);
        Vector2        start = new Vector2(1f, 1f);
        List <Vector2> map   = scriptLoad.GetMap();

        LoadSystem loadSystem = new LoadSystem(start, end, map);


        List <LoadSystem.LoadPoint> path = loadSystem.FindLoadPath();

        if (path != null)
        {
            foreach (LoadSystem.LoadPoint p in path)
            {
                Debug.Log(p.X + "  " + p.Y);
                ShowLoad(p.ToVector2());
            }
        }
        else
        {
            Debug.Log(null);
        }
    }
 public void PlayPressed()
 {
     LoadSystem.DeleteSaves();
     MoveToTheGameScene();
 }
Exemplo n.º 12
0
    void LoadGame()
    {
        MainScreenCache.SetActive(false);

        // # 로드 코드
        SaveSystem.LoadPhysicalSkill();
        SaveSystem.LoadSkill();
        SaveSystem.LoadStat();
        SaveSystem.LoadItem();

        LoadSystem.LoadPhysicalSkill();
        LoadSystem.LoadSkill();
        LoadSystem.LoadStat();
        LoadSystem.LoadItem();
        BasicUI.SetActive(true);
        Time.timeScale = 1;
        DF.focalLength.Override(0);

        if (Player_Stat.instance.isLight)
        {
            BasicUI.transform.GetChild(20).gameObject.SetActive(true);
            BasicUI.transform.GetChild(20).transform.GetChild(0).gameObject.SetActive(true);    //차징 UI의 첫번째 자식(경량화살)을 활성화
            Destroy(BasicUI.transform.GetChild(20).transform.GetChild(1).gameObject);           //두번째 자식(은화살)은 파괴
            Destroy(BasicUI.transform.GetChild(20).transform.GetChild(2).gameObject);           //세번째 자식(불화살)도 파괴

            SilverArrow.gameObject.SetActive(false);
            FireArrow.gameObject.SetActive(false);
            Middle_Left_ShotPoint.gameObject.SetActive(false);
            Middle_Right_ShotPoint.gameObject.SetActive(false);
            Full_Left_ShotPoint.gameObject.SetActive(false);
            Full_Right_ShotPoint.gameObject.SetActive(false);
            Bottle1.gameObject.SetActive(false);
            Bottle2.gameObject.SetActive(false);
            Bottle3.gameObject.SetActive(false);
            SkillChoose.GetComponent <SkillChoose>().MinValue = 1;
            SkillChoose.GetComponent <SkillChoose>().MaxValue = 8;
            GameObject.Find("SkillChoose").GetComponent <SkillChoose>().sprites = Resources.LoadAll <Sprite>("Light_Arrow_SkillIcon");
        }
        else if (Player_Stat.instance.isSilver)
        {
            BasicUI.transform.GetChild(20).gameObject.SetActive(true);
            BasicUI.transform.GetChild(20).transform.GetChild(1).gameObject.SetActive(true);
            Destroy(BasicUI.transform.GetChild(20).transform.GetChild(0).gameObject);
            Destroy(BasicUI.transform.GetChild(20).transform.GetChild(2).gameObject);

            LightArrow.gameObject.SetActive(false);
            FireArrow.gameObject.SetActive(false);
            Bottle1.gameObject.SetActive(false);
            Bottle2.gameObject.SetActive(false);
            Bottle3.gameObject.SetActive(false);
            SkillChoose.GetComponent <SkillChoose>().MinValue = 15;
            SkillChoose.GetComponent <SkillChoose>().MaxValue = 24;
            GameObject.Find("SkillChoose").GetComponent <SkillChoose>().sprites = Resources.LoadAll <Sprite>("Silver_Arrow_SkillIcon");
        }
        else if (Player_Stat.instance.isFire)
        {
            BasicUI.transform.GetChild(20).gameObject.SetActive(true);
            BasicUI.transform.GetChild(20).transform.GetChild(2).gameObject.SetActive(true);
            Destroy(BasicUI.transform.GetChild(20).transform.GetChild(1).gameObject);
            Destroy(BasicUI.transform.GetChild(20).transform.GetChild(0).gameObject);

            LightArrow.gameObject.SetActive(false);
            SilverArrow.gameObject.SetActive(false);
            SkillChoose.GetComponent <SkillChoose>().MinValue = 25;
            SkillChoose.GetComponent <SkillChoose>().MaxValue = 32;
            GameObject.Find("SkillChoose").GetComponent <SkillChoose>().sprites = Resources.LoadAll <Sprite>("Fire_Arrow_SkillIcon");
        }
    }