示例#1
0
文件: Init.cs 项目: uasouz/YUh
 void Start()
 {
     saveload = GetComponent<SaveLoad>();
     YUh.Sono = 100;
     YUh.Beth_viu = false;
     YUh.Escondida = false;
     Camera_principal = GameObject.Find("Main Camera");
     Camera_beth = GameObject.Find("CameraBeth");
     Player = GameObject.Find("Player");
     Plight = GameObject.Find("Plight");
     Plight2 = GameObject.Find("Plight2");
     Seta_dir = GameObject.Find("Seta_dir");
     Seta_esq = GameObject.Find("Seta_esq");
     Lifebar = GameObject.Find("lifebar");
     Pausemenu = GameObject.Find("Pausemenu");
     B_menu = GameObject.Find("Botao_menu");
     B_play = GameObject.Find("Botao_Play");
     B_reset = GameObject.Find("Botao_reset");
     B_pausar = GameObject.Find("Botao_Pausar");
     Painel = GameObject.Find("Painel");
     Loading = GameObject.Find("Loading");
     Soundb = GameObject.Find("Sound");
     Texto = GameObject.Find("Texto");
     Caixa = GameObject.Find("Caixa");
 }
示例#2
0
 void Awake()
 {
     if (instance == null) {
         instance = this;
     } else if (instance != this){
         Destroy(gameObject);
     }
     DontDestroyOnLoad (gameObject);
 }
	void Start () 
	{
		mSaveLoad = new SaveLoad();
		mSaveLoad.SetMissionTextAsset(MISSION_TEXT_ASSET); 
		mUserData = mSaveLoad.LoadUser(); 
		mMissionData = mSaveLoad.LoadMissionData(); 
		
		Application.LoadLevel("Gameplay");
	}
示例#4
0
 void Awake()
 {
     SaveLoad sv = new SaveLoad ();
     sv.loadFileLevel ();
 }
 private void Start()
 {
     SLManager = SaveLoad.Instance;
     ActualizateUI();
 }
示例#6
0
 public void Settings()
 {
     effectsVolume.value = SaveLoad.LoadEffectsVolume();
     soundVolume.value   = SaveLoad.LoadSoundVolume();
     settingsPanel.SetActive(true);
 }
示例#7
0
 private void GameWon()
 {
     SaveLoad.Save(GameManager.instance.time.ToString(), GameManager.instance.score.ToString(), GameManager.instance.coin.ToString());
     SceneManager.LoadScene(SCREEN_TO_OPEN);
 }
示例#8
0
 public void OnClick()
 {
     SaveLoad.SaveHero();
 }
示例#9
0
 // Use this for initialization
 void Start()
 {
     GetComponentInChildren <Text>().text = Convert.ToString(SaveLoad.getPlayerTemp().getOro());
 }
示例#10
0
 private void Awake()
 {
     saveLoadManager = GameObject.Find("Game").GetComponent <SaveLoad>();
     Camera.main.gameObject.GetComponent <CameraSmoothFollow>().enabled = true;
     Camera.main.gameObject.GetComponent <CameraSmoothFollow>().player  = this;
 }
        /// <summary>
        /// Occurs on game save.
        /// </summary>
        public override void OnSave()
        {
            // Written, 30.03.2019

            SaveLoad.SerializeSaveFile(this, this.truckEngine.getSaveInfo(), fileName);
        }
示例#12
0
 public static void DeleteFile()
 {
     SaveLoad.Delete(0, false);
     DataStorage.ResetValues();
     Objectives.ResetValues();
 }
示例#13
0
 void Awake()
 {
     if(Instance==null){
         Instance=this;
     }
 }
示例#14
0
    public void Start()
    {
        if (SaveLoadManager == null)
        {
            DontDestroyOnLoad(SaveLoadManager);
            SaveLoadManager = this;
        }
        else if (SaveLoadManager != this)
            Destroy(gameObject);

        Manager = FindObjectOfType<GameManager>();
        Player = FindObjectOfType<PlayerController>();
        Eva = GameObject.FindGameObjectWithTag("Eva");
        PlatformSpawner = FindObjectOfType<SpawnManager>();
        HorizontalSpawner = PlatformSpawner.GetComponent<HorizontalSpawner>();
        VerticalSpawner = PlatformSpawner.GetComponent<VerticalSpawner>();
    }
示例#15
0
 public void button_Reset_Save()
 {
     SaveLoad.Reset();
 }
示例#16
0
 //back button code
 public void Menu()
 {
     SaveLoad.Save();
     SceneManager.LoadScene(0);
 }
示例#17
0
 private void SaveCurrentLevel()
 {
     SaveLoad.GetInstance().Load();
     SaveLoad.GetInstance().pData.lastLevel = LevelManager.instance.levelData.levelNumber;
     SaveLoad.GetInstance().Save(SaveLoad.GetInstance().pData);
 }
示例#18
0
 public static SaveLoad Get()
 {
     if (m_Instance == null)
         m_Instance = (SaveLoad)FindObjectOfType(typeof(SaveLoad));
     return m_Instance;
 }
 public TimingValueService(IConfiguration configuration, SaveLoad repo, ITimy3Reader timy3Reader)
 {
     _configuration = configuration;
     _repo          = repo;
     _timy3Reader   = timy3Reader;
 }
示例#20
0
    void Update()
    {
        AudioListener.volume = gameVolume;

        if (SceneManager.GetActiveScene().name != "Main Menu")
        {
            if ((SceneManager.GetActiveScene().name != "Super Seoul Ball 3D") && (startTime == -1) && (!(transform.Find("Codec").gameObject.activeInHierarchy)))
            {
                startTime = Time.time;
                transform.Find("Timer").gameObject.SetActive(true);
            }

            if ((SceneManager.GetActiveScene().name != "Super Seoul Ball 3D") && (transform.Find("Timer").gameObject.activeInHierarchy == true) && (finalBossKilled == false))
            {
                currentTime = Time.time - startTime;
                transform.Find("Timer/Timer Minutes").GetComponent <Text>().text      = ((int)(currentTime / 60)).ToString("00");
                transform.Find("Timer/Timer Seconds").GetComponent <Text>().text      = ((int)(currentTime % 60)).ToString("00");
                transform.Find("Timer/Timer Milliseconds").GetComponent <Text>().text = (((int)(currentTime * 100f) % 100)).ToString("00");
            }

            if (Input.GetButtonDown("Start"))
            {
                transform.Find("Global Menu").gameObject.SetActive(!transform.Find("Global Menu").gameObject.activeInHierarchy);
            }

            try
            {
                levelCompleted = GameObject.Find("levelCompleted").gameObject;
                if (levelCompleted != null)
                {
                    if (levelTesting != null)
                    {
                        Destroy(levelCompleted);
                        StartCoroutine(fadeOutSpecial());
                    }
                    else if (SceneManager.GetActiveScene().buildIndex == 9)
                    {
                        SaveLoad.Load();
                        if (currentTime > SaveLoad.bestScore)
                        {
                            SaveLoad.bestScore = currentTime;
                            SaveLoad.Save();
                        }
                        Destroy(levelCompleted);
                        StartCoroutine(fadeOutSpecial());
                    }
                    else
                    {
                        Destroy(levelCompleted);
                        StartCoroutine(fadeOut());
                    }
                }
            }
            catch (NullReferenceException e) { }
        }
        else
        {
            if (levelTesting != null)
            {
                Destroy(levelTesting);
            }
            transform.Find("Fade").GetComponent <Canvas>().sortingOrder = 8;
            transform.Find("Fade/Fade").gameObject.SetActive(false);
            Destroy(transform.gameObject);
        }
    }
示例#21
0
 public void ResetLevelProgress()
 {
     SaveLoad.levelsUnlocked = 1;
     SaveLoad.Save();
     FindObjectOfType <SaveLoadManager>().RefreshUnlockedLevels();
 }
示例#22
0
 private void Awake()
 {
     GMInst   = GameObject.Find("-GM");
     saveload = GMInst.GetComponent <SaveLoad>();
 }
示例#23
0
 /*
  *@brief : all the functions call when the player tap play
  */
 public void launchGame()
 {
     SaveLoad.Load();
     setPlayer();
 }
    public void Initialize()
    {
        //Debug.Log ( System.IO.Directory.GetFiles(Application.dataPath + LevelData.DIRECTORY)[0]);

        CreateLevel(SaveLoad.Load <LevelData> (System.IO.Directory.GetFiles(Application.dataPath + LevelData.DIRECTORY)[0]));
    }
示例#25
0
 void optionListener()
 {
     SaveLoad.clearSave();
 }
示例#26
0
 void Start()
 {
     SetVolumes(SaveLoad.GetInstance().pData.musicValue);
     AudioListener.pause = SaveLoad.GetInstance().pData.musicMute;
 }
示例#27
0
 void lootListener()
 {
     SaveLoad.chargeLoot();
 }
 private bool IsFirstTime()
 {
     return(SaveLoad.IsFirstTime());
 }
示例#29
0
 public void saveState(string filename)
 {
     state.reset();
     state.failures++;
     SaveLoad.Save(state, filename);
 }
示例#30
0
        private void gStateUpdate()
        {
            #region Menu State

            if (this.gState == GameState.Menu)
            {
                this.menu.Update(mouseInput); // Update Main Menu Option Highlight *IF* user is currently in MENU.


                if (menu.GetChoice() == MenuChoice.Play && mouseInput.IsLeftClicked() == true)
                {
                    gState = GameState.Playing;
                }
                else if (menu.GetChoice() == MenuChoice.Help && mouseInput.IsLeftClicked() == true)
                {
                    gState = GameState.Help;
                }
                else if (menu.GetChoice() == MenuChoice.Editor && mouseInput.IsLeftClicked() == true)
                {
                    this.editorGUI = new Editor.EditorGUI(32, 22, false);
                    this.editorGUI.LoadContent(Content);
                    gState = GameState.Editor;
                    this.editorGUI.Show();
                }
                else if (menu.GetChoice() == MenuChoice.Exit && mouseInput.IsLeftClicked() == true)
                {
                    this.Exit();
                }

                else if (menu.GetChoice() == MenuChoice.Load && mouseInput.IsLeftClicked() == true)
                {
                    this.saveLoad = new SaveLoad(hero, xMap, yMap);

                    this.saveLoad.LoadGame(this.hero, this, this.Content);
                }
            }

            #endregion

            #region Help State

            else if (gState == GameState.Help)
            {
                if (keyboardInput.Pressed(Keys.Escape))
                {
                    gState = GameState.Menu;
                }
            }
            #endregion

            #region Editor State

            else if (gState == GameState.Editor)
            {
                if (keyboardInput.Pressed(Keys.Escape))
                {
                    this.editorGUI.Close();
                    gState = GameState.Menu;
                }

                this.editorGUI.UpdateInput(mouseInput, keyboardInput);
            }

            #endregion

            #region Playing State

            else if (gState == GameState.Playing)
            {
                this.hero.Update(mouseInput, keyboardInput, levels[xMap, yMap], saveLoad, gameTime);
                this.hero.UpdateStats();
                this.Warp(this.hero);

                if (this.hero.isAlive == false)
                {
                    ReinitializeGame();
                    this.gState = GameState.Dead;
                }


                if (keyboardInput.Pressed(Keys.Escape))
                {
                    gState = GameState.Pause;
                }

                if (this.levels[xMap, yMap].CollideWith(this.hero.collisionRect) == "slime")
                {
                    this.fight.ResetFight(hero, new Slime(Content));
                    this.gState = GameState.Fight;
                }

                if (this.levels[xMap, yMap].CollideWith(this.hero.collisionRect) == "wizard")
                {
                    this.fight.ResetFight(hero, new Wizard(Content));
                    this.gState = GameState.Fight;
                }

                if (this.levels[xMap, yMap].CollideWith(this.hero.collisionRect) == "necromancer")
                {
                    this.fight.ResetFight(hero, new Necromancer(Content));
                    this.gState = GameState.Fight;
                }

                if (this.levels[xMap, yMap].CollideWith(this.hero.collisionRect) == "bird")
                {
                    this.fight.ResetFight(hero, new Bird(Content));
                    this.gState = GameState.Fight;
                }

                if (this.levels[xMap, yMap].CollideWith(this.hero.collisionRect) == "goblin")
                {
                    this.fight.ResetFight(hero, new Goblin(Content));
                    this.gState = GameState.Fight;
                }

                if (this.levels[xMap, yMap].CollideWith(this.hero.collisionRect) == "store")
                {
                    this.gState = GameState.Store;
                }

                if (keyboardInput.Pressed(Keys.I))
                {
                    gState = GameState.Inventory;
                }
            }

            #endregion

            #region Inventory State

            else if (gState == GameState.Inventory)
            {
                if (keyboardInput.Pressed(Keys.I))
                {
                    gState = GameState.Playing;
                }

                this.heroInventory.Update(mouseInput, keyboardInput);
                this.hero.UpdateStats();
            }

            #endregion

            #region Store State

            else if (gState == GameState.Store)
            {
                if (keyboardInput.Pressed(Keys.Escape))
                {
                    gState = GameState.Playing;
                }

                this.hero.UpdateStats();
                this.storeGUI.Update(mouseInput, keyboardInput);
            }

            #endregion

            #region Pause State

            else if (gState == GameState.Pause)
            {
                this.pause.Update(mouseInput); // Update Pause Menu Option Highlight *IF* user is currently in MENU.


                if (pause.GetChoice() == MenuChoice.Resume && mouseInput.IsLeftClicked() == true)
                {
                    gState = GameState.Playing;
                }
                else if (keyboardInput.Pressed(Keys.Escape))
                {
                    gState = GameState.Playing;
                }
                else if (pause.GetChoice() == MenuChoice.Save && mouseInput.IsLeftClicked() == true)
                {
                    this.saveLoad = new SaveLoad(hero, xMap, yMap);

                    this.saveLoad.SaveGame();
                }
                else if (pause.GetChoice() == MenuChoice.Load && mouseInput.IsLeftClicked() == true)
                {
                    this.saveLoad = new SaveLoad(hero, xMap, yMap);

                    this.saveLoad.LoadGame(this.hero, this, this.Content);
                }
                else if (pause.GetChoice() == MenuChoice.Menu && mouseInput.IsLeftClicked() == true)
                {
                    gState = GameState.Menu;
                }
            }

            #endregion

            #region Dead State

            else if (gState == GameState.Dead)
            {
                if (keyboardInput.Pressed(Keys.Escape))
                {
                    gState = GameState.Menu;
                }
            }

            #endregion

            #region Fight State

            else if (gState == GameState.Fight)
            {
                this.fight.Update(gameTime, mouseInput, keyboardInput);

                if (this.fight.CheckFinished() == true)
                {
                    this.levels[xMap, yMap].EntityToBlank(hero.collisionRect);

                    this.gState = GameState.Playing;
                }
            }

            #endregion
        }
示例#31
0
 void Save()
 {
     SaveLoad.Save <List <GameObject> >(objects, "Defeated");
 }
示例#32
0
 // Start is called before the first frame update
 void Start()
 {
     Instance       = this;
     lastLevel      = SaveLoad.Load();
     Time.timeScale = 1f;
 }
示例#33
0
 public void Show()
 {
     musicSlider.value = SaveLoad.GetInstance().pData.musicValue;
     enabled           = true;
 }
示例#34
0
    public void save()
    {
        Driver driver = Camera.main.GetComponent <Driver> ();

        SaveLoad.Save();
    }
示例#35
0
 private void OnMute()
 {
     SaveLoad.GetInstance().pData.musicMute = true;
     SaveLoad.GetInstance().Save();
 }
示例#36
0
文件: Savegame.cs 项目: uasouz/YUh
 //it's static so we can call it from anywhere
 void Awake()
 {
     saver = this;
 }
示例#37
0
 private void OnNoMute()
 {
     SaveLoad.GetInstance().pData.musicMute = false;
     SaveLoad.GetInstance().Save();
 }
示例#38
0
 void Start()
 {
     obj = GameObject.Find ("Gerenciador");
     save = (SaveLoad)obj.GetComponent(typeof(SaveLoad));
 }
示例#39
0
 public void save()
 {
     SaveLoad.save(rd);
 }