示例#1
0
    /// <summary>
    /// 現在なっている音に変更後の音量を適用させる
    /// </summary>
    public void SoundVolumeApplication()
    {
        soundInfo.MainVolume      = MainVolume;
        soundInfo.BackMusicVolume = BackMusicVolume;
        soundInfo.SfxVolume       = SfxVolume;

        SaveLoadSystem.Save(soundInfo, SAVE_FILE_NAME);

        //バックミュージックがなければ処理しない
        if (backMusicObject != null)
        {
            //音量再適用
            backMusicObject.GetComponent <AudioSource>().volume = MainVolume * BackMusicVolume;
        }

        //音量再適用
        for (int i = 0; i < sfxList.Count; i++)
        {
            if (sfxList[i] == null)
            {
                continue;
            }
            else
            {
                sfxList[i].volume = MainVolume * BackMusicVolume;
            }
        }
    }
示例#2
0
 public void LoadGameSlots()
 {
     saveSlot1 = SaveLoadSystem.LoadGameData(1);
     saveSlot2 = SaveLoadSystem.LoadGameData(2);
     saveSlot3 = SaveLoadSystem.LoadGameData(3);
     saveSlot4 = SaveLoadSystem.LoadGameData(4);
 }
示例#3
0
    public void SetUp()
    {
        width    = new int[5];
        width[0] = 1920;
        width[1] = 1600;
        width[2] = 1280;
        width[3] = 960;
        width[4] = 800;

        height    = new int[5];
        height[0] = 1080;
        height[1] = 900;
        height[2] = 720;
        height[3] = 540;
        height[4] = 450;


        OptionsData data = SaveLoadSystem.LoadOptions();

        qualityDropdown.value    = data.quality;
        resolutionDropdown.value = data.resolution;
        fullscreenToggle.isOn    = data.fullscreen;
        music.value    = data.music;
        ambience.value = data.ambience;
        effects.value  = data.effects;


        //SetGraphicsSettings();
        SetAudioSettings();
    }
示例#4
0
    private void Start()
    {
        subject = Subject.getInstance();

        if (!observerDifficultAI.observerState && !observerVoice.observerState)
        {
            new observerDifficultAI(subject);
            new observerVoice(subject);
        }

        if (!File.Exists(Application.persistentDataPath + "save.binary"))
        {
            SettingData data = new SettingData(.5f, "MID");

            SaveLoadSystem.Save(data);

            diff = "MID";
            voi  = .5f;
        }
        else
        {
            diff = SaveLoadSystem.Load().difficult;
            voi  = SaveLoadSystem.Load().voice;
        }

        subject.setDifficultAndVoice(diff, voi);
    }
示例#5
0
 private void Awake()
 {
     GetComponent <GUIWindow>().OnClose.AddListener(() =>
     {
         SaveLoadSystem.SaveConfig();
     });
 }
示例#6
0
 public void battleDialogCallback()
 {
     SaveLoadSystem.getInstance().currentSceneType = SaveLoadSystem.SceneType.ATRIUM;
     SaveLoadSystem.getInstance().atriumSceneStateArr[(int)SaveLoadSystem.AtriumSceneState.FROMLG2] = true;
     SaveLoadSystem.getInstance().save();
     gameObject.SendMessage("changeScene", "LG2_stage");
 }
示例#7
0
 void groupBattle()
 {
     GetComponent <sceneInterface>().gotoBattle();
     Destroy(this.gameObject);
     SaveLoadSystem.getInstance().lg2SceneStateArr[(int)SaveLoadSystem.Lg2SceneState.BEGANDIALOG] = true;
     SaveLoadSystem.getInstance().save();
 }
示例#8
0
    private void Start()
    {
        GameData gameData = SaveLoadSystem.LoadGameData();

        hasNoAds = gameData.hasNoAds;
        SetCorrectSprite();
    }
示例#9
0
    public void UserDataCreate()
    {
        if (!controller.CheckFile("UserData"))
        {
            LocalSave();
            return;
        }

        button.SetActive(false);
        note.SetActive(true);

        userData = new UserData(name.text, controller.GetLength("UserData"));



        string[] userDataStr = new string[3];

        userDataStr[0] = userData.userName;
        userDataStr[1] = userData.id.ToString();
        userDataStr[2] = userData.bestTime.ToString();

        StartCoroutine(controller.AddSave("UserData", userDataStr, MyDestroy));

        TitleManager titleManager = FindObjectOfType <TitleManager>();

        SaveLoadSystem.Save((object)userData, "UserData");
        if (titleManager != null)
        {
            titleManager.Initialization();
        }
    }
示例#10
0
    void Start()
    {
        Map             = new List <List <Location> >();
        RecLoc          = new List <Location>();
        Survivors       = new List <Survivor>();
        SelectedSurv    = new List <Survivor>();
        ActiveMissions  = new List <Mission>();
        DefenseSurv     = new List <Survivor>();
        TempDefenseSurv = new List <Survivor>();

        CurLocId             = new Index(0, 0);
        CurMissionId         = 0;
        MapSize              = 10;
        Days                 = 0;
        IdleSurv             = 0;
        LivingSpace          = 0;
        Food                 = 0;
        Happiness            = 0;
        Defense              = 0;
        DefenseFromBuildings = 0;
        FoodExtraction       = 0;
        FoodIntake           = 0;

        for (int i = 0; i < MapSize; i++)
        {
            Map.Add(new List <Location>());

            for (int j = 0; j < MapSize; j++)
            {
                Map[i].Add(null);
            }
        }

        _saveLoadSysem = GetComponent <SaveLoadSystem>();
    }
示例#11
0
    public void LoadGameData()
    {
        GameData gameData = SaveLoadSystem.LoadGameData();

        if (gameData != null)
        {
            bestDistance   = gameData.bestDistance;
            collectedCoins = gameData.coin;
            selectedCar    = gameData.selectedCar;

            //Cars Lock/Unlock Data
            lockList = gameData.lockList;
            for (int i = 0; i < lockList.Count; i++)
            {
                carDatas[i].unlocked = lockList[i];
            }
        }
        else
        {
            bestDistance   = 0.0f;
            collectedCoins = 0;
            selectedCar    = CarModel.Polo;

            //Cars Lock/Unlock Data
            for (int i = 0; i < carDatas.Length; i++)
            {
                lockList.Add(carDatas[i].unlocked);
            }

            SaveGameData();
        }
    }
示例#12
0
 void OnMouseUp()
 {
     renderer.material.color = new Color(renderer.material.color.r, renderer.material.color.g, renderer.material.color.b, 1f);
     gameObject.audio.Play();
     SaveLoadSystem.getInstance().load();
     if (SaveLoadSystem.getInstance().currentSceneType == SaveLoadSystem.SceneType.LAB)
     {
         Debug.Log("MainMenu: Loading Lab scene");
         AutoFade.LoadLevel("lab_stage", 0.5f, 0.5f, Color.black);
     }
     else if (SaveLoadSystem.getInstance().currentSceneType == SaveLoadSystem.SceneType.ATRIUM)
     {
         AutoFade.LoadLevel("atrium_stage", 0.5f, 0.5f, Color.black);
     }
     else if (SaveLoadSystem.getInstance().currentSceneType == SaveLoadSystem.SceneType.LG2)
     {
         AutoFade.LoadLevel("LG2_stage", 0.5f, 0.5f, Color.black);
     }
     else if (SaveLoadSystem.getInstance().currentSceneType == SaveLoadSystem.SceneType.SUNDIAL)
     {
         AutoFade.LoadLevel("sundial", 0.5f, 0.5f, Color.black);
     }
     else if (SaveLoadSystem.getInstance().currentSceneType == SaveLoadSystem.SceneType.UNDERSUN1)
     {
         AutoFade.LoadLevel("SecretChamberBefore", 0.5f, 0.5f, Color.black);
     }
     else if (SaveLoadSystem.getInstance().currentSceneType == SaveLoadSystem.SceneType.UNDERSUN2)
     {
         AutoFade.LoadLevel("SecretChamberAfter", 0.5f, 0.5f, Color.black);
     }
 }
示例#13
0
    public static void Save()
    {
        gameData.playerPosition = new float[] { GetPlayer().transform.position.x, GetPlayer().transform.position.y };
        gameData.sceneAlias     = SceneManager.GetActiveScene().name;

        SaveLoadSystem.Save(gameData);
    }
示例#14
0
    public void SetupChallenge()
    {
        List <ChallengeInfo> challengeInfo = GuessManager.Instance.ChallengeInfos;

        challengeItemObjectPool.ReturnAllObjectsToPool();
        PlayerData playerData = SaveLoadSystem.Load();

        if (playerData != null)
        {
            for (int i = 0; i < challengeListContainer.childCount; i++)
            {
                GameObject challengeGO = challengeListContainer.GetChild(i).gameObject;
                challengeGO.SetActive(true);
                ChallengeListItem challenge = challengeGO.transform.GetComponent <ChallengeListItem>();
                challenge.Setup(challengeInfo[i].title, playerData.challengeList[i].curGoal, challengeInfo[i].goal, challengeInfo[i].challengeDescription);
            }
        }
        else
        {
            for (int i = 0; i < challengeListContainer.childCount; i++)
            {
                GameObject challengeGO = challengeListContainer.GetChild(i).gameObject;
                challengeGO.SetActive(true);
                ChallengeListItem challenge = challengeGO.transform.GetComponent <ChallengeListItem>();
                challenge.Setup(challengeInfo[i].title, 0, challengeInfo[i].goal, challengeInfo[i].challengeDescription);
            }
        }
    }
示例#15
0
 // Use this for initialization
 void Start()
 {
     if (SaveLoadSystem.getInstance().lg2SceneStateArr [(int)SaveLoadSystem.Lg2SceneState.SAVEPRED])
     {
         Destroy(this.gameObject);
     }
 }
    public void Show(string titleText)
    {
        gameObject.SetActive(true);

        title.text           = titleText;
        btnLoad.interactable = SaveLoadSystem.CheckForDataFile();
    }
示例#17
0
    private void Start()
    {
        GameData gameData = SaveLoadSystem.LoadGameData();

        musicEnabled = gameData.hasMusic;
        SetCorrectSprite();
    }
示例#18
0
    public void Initialize(List <ItemObject> itemObjects, SaveLoadSystem saveLoadSystem)
    {
        _saveLoadSystem = saveLoadSystem;

        _itemObjects = itemObjects;

        foreach (var item in _inventorySlots)
        {
            item.Initialzie();
            item.OnPointerEnterEvent += OnPoinerEnterItem;
            item.OnPointerExitEvent  += OnPointerExitItem;
        }

        foreach (var item in _itemObjects)
        {
            if (item.Item.InInventory)
            {
                PushItemInInventory(item, true);
            }
        }

        _dragger.OnItemDropEvent          += OnItemDropInInventory;
        _inventoryObject.OnInventoryOpen  += InventoryOpen;
        _inventoryObject.OnInventoryClose += InventoryClose;
    }
示例#19
0
 public void ButtonPressYes()
 {
     // delete selected save file
     SaveLoadSystem.Delete(_mainMenuLoadSelectedMenuController.GetSaveFileNumber());
     // switch to main menu's load menu
     ((MainMenuController)menuMaster).SwitchToLoadMenu();
 }
示例#20
0
 void OnMouseUp()
 {
     renderer.material.color = new Color(renderer.material.color.r, renderer.material.color.g, renderer.material.color.b, 1f);
     gameObject.audio.Play();
     SaveLoadSystem.getInstance().resetSave();
     AutoFade.LoadLevel(startStageName, 0.5f, 0.5f, Color.black);
 }
    private void Awake()
    {
        Instance = this;

        titleScreenBack = GetComponent <Image>();
        saveLoadSystem  = GetComponentInParent <SaveLoadSystem>();
    }
示例#22
0
 void LoadInvetory()
 {
     if (SaveLoadSystem.SaveExists("Inventory"))
     {
         GiveItems(SaveLoadSystem.Load <List <Item> >("Inventory"));
     }
 }
 void Load()
 {
     if (SaveLoadSystem.SaveExists("CollectedItems"))
     {
         CollectedItems = SaveLoadSystem.Load <HashSet <string> >("CollectedItems");
     }
 }
示例#24
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "Target")
        {
            FindObjectOfType <AudioManager>().Play("GameOver");
            gamesPlayed++;
            if (gamesPlayed >= 3)
            {
                FindObjectOfType <AdController>().ShowVideoLost();
                gamesPlayed = 0;
            }
            gameOverScreen.gameObject.SetActive(true);
            gameLost = true;
            endGameScoreText.text = "Score: " + inGameScoreText.text;
            coinsText.text        = "Coins: " + FindObjectOfType <CoinsPerGameCounter>().coinsPerGame;

            int score = GameObject.FindGameObjectWithTag("UI").GetComponent <UIController>().score;

            if (score > GlobalVariables.highestScore)
            {
                GlobalVariables.highestScore = score;
            }

            highestScoreText.text = "Highest Score: " + GlobalVariables.highestScore;

            SaveLoadSystem.SaveData();

            foreach (GameObject enemy in GameObject.FindGameObjectsWithTag("Target"))
            {
                enemy.transform.rotation = Quaternion.Euler(0, 0, 0);
                Instantiate(glasses, enemy.transform, false);
            }
        }
    }
示例#25
0
    public void RestartUI()
    {
        gameData = SaveLoadSystem.LoadGameData();
        HideContinueButton();
        newHighScoreImage.gameObject.SetActive(false);
        SetAllScoresTexts();
        if (!shouldKeepContinueButtonHidden)
        {
            ShowContinueButtonByChance();
        }
        else
        {
            shouldKeepContinueButtonHidden = false;
        }

        EnableRetryButtonTouch();
        EnableMenuButtonTouch();

        if (!gameData.hasNoAds)
        {
            if (interstitialAdScore <= 1.0f)
            {
                LoadIntersitialAd();
            }
        }
    }
示例#26
0
    //return if answer correct
    public override bool openTable(int tableNo)
    {
        if (tableNo >= 0 && tableNo < tablesOpen.Length)
        {
            tablesOpen [tableNo] = !tablesOpen [tableNo];
            Debug.Log("Big Table Array: " + this.getTablesOpen());

            sl_OpenDoorChecker = false;
            issueTurnOnOffDialog(tableNo);

            if (checkArray())
            {
                Debug.Log("get it right!");
                GameObject.Find("Door").gameObject.SendMessage("openDoor", true, SendMessageOptions.DontRequireReceiver);


                SaveLoadSystem.getInstance().labSceneStateArr[(int)SaveLoadSystem.LabSceneState.PUZZLESOLVED] = true;
                SaveLoadSystem.getInstance().save();
                issueSuccessPuzzlingDialog();
                return(true);
            }
        }
        else
        {
            Debug.LogError("tableNo " + tableNo + " not valid");
        }
        return(false);
    }
示例#27
0
    private void Start()
    {
        GameData gameData = SaveLoadSystem.LoadGameData();

        soundEffectsEnabled = gameData.hasSoundEffects;
        SetCorrectSprite();
    }
示例#28
0
    void Save()
    {
        GameObject player = GameObject.FindGameObjectWithTag("Player");

        GameObject[] drones = GameObject.FindGameObjectsWithTag("Mortal");
        GameState    state  = new GameState();

        state.SceneName = UnityEngine.SceneManagement.SceneManager.GetActiveScene().name;
        float playerHealth = player.GetComponent <Health>().currentHealth;

        state.Player = new GameState.Actor(playerHealth, player);
        List <GameState.Drone> dronesData = new List <GameState.Drone>();

        for (int i = 0; i < drones.Length; i++)
        {
            if (drones[i] != null)
            {
                Health droneHealthObj = drones[i].GetComponent <Health>();
                if (droneHealthObj != null)
                {
                    float droneHealth = droneHealthObj.currentHealth;
                    if (droneHealth > 0)
                    {
                        dronesData.Add(new GameState.Drone(droneHealth, drones[i]));
                    }
                }
            }
        }
        state.Drones       = dronesData.ToArray();
        state.checkpointId = id;
        SaveLoadSystem.Save(state);
        Debug.Log(SaveLoadSystem.gameState.Drones.Length);
    }
示例#29
0
    void Start()
    {
        subject = Subject.getInstance();

        diff = SaveLoadSystem.Load().difficult;
        voi  = SaveLoadSystem.Load().voice;

        toggles[0].isOn = false;
        toggles[1].isOn = false;
        toggles[2].isOn = false;

        if (diff.Equals("EASY"))
        {
            toggles[0].isOn = true;
        }
        else if (diff.Equals("MID"))
        {
            toggles[1].isOn = true;
        }
        else
        {
            toggles[2].isOn = true;
        }

        voiceScrollBar.value = voi;
    }
示例#30
0
 private void Awake()
 {
     GetComponent <GUIButton>().onClick.AddListener(() =>
     {
         SaveLoadSystem.LoadGame();
         SaveLoadSystem.LoadStash();
     });
 }