public void OnApplicationFocus(bool focusStatus) { if (!focusStatus) { PlayerDataUtils.saveData(); } }
private void Awake() { //Debug.Log("脚本本身的启动与关闭。。。。"); //实例化工具类(单例) playerDataUtils = PlayerDataUtils.getInstance(); }
public void Play() { PlayerDataUtils.loadData(); LevelUtils.currentLevel = LevelUtils.GetLevel(PlayerDataUtils.playerData.currentLevelIndex); SceneManager.LoadScene("Play"); Done_GameController.instance.Start(); }
void OnNextButtonClick() { PlayerDataUtils.playerData.currentLevelIndex = PlayerDataUtils.playerData.currentLevelIndex + 1; LevelUtils.currentLevel = LevelUtils.GetLevel(PlayerDataUtils.playerData.currentLevelIndex); PlayerDataUtils.saveData(); SceneManager.LoadScene("Play"); gameObject.SetActive(false); }
void OnButtonClick() { int levelNumber = Int32.Parse(EventSystem.current.currentSelectedGameObject.GetComponentInChildren<Text>().text); LevelUtils.currentLevel = LevelUtils.GetLevel(levelNumber); PlayerDataUtils.playerData.currentLevelIndex = levelNumber; PlayerDataUtils.saveData(); SceneManager.LoadScene("Play"); }
private void Awake() { playerDataUtils = PlayerDataUtils.getInstance(); // activityResultPanel = transform.parent.Find("ActivityResult_Panel").gameObject; actressImage = transform.Find("Actress_Image").GetComponent <Image>(); characterNameText = transform.Find("Dialog_Image/Name_Text").GetComponent <Text>(); dialogText = transform.Find("Dialog_Image/Dialog_Text").GetComponent <Text>(); actressSprite = Resources.Load <Sprite>("UIImage/Actress/Actress_1"); //this.gameObject.SetActive(false); }
public static PlayerDataUtils getInstance() { if (instance == null) { instance = new PlayerDataUtils(); playerData = Resources.Load <PlayerData>("PlayerData"); designData = Resources.Load <DesignData>("DesignData"); } return(instance); }
// Use this for initialization void Start() { LevelUtils.initLevel(); PlayerDataUtils.loadData(); if (PlayerDataUtils.playerData.highestLevelUnlocked != 0) { currentUnlockedLevel = PlayerDataUtils.playerData.highestLevelUnlocked; } for (int i = 0; i < LevelUtils.GetLevels().Count; i++) { CreateSelectLevel(i); } }
void Update() { if (isStop) { return; } if (healthbar.GetComponent <HealthbarController>().GetCurrentHealth() <= 0) { GameoverPanel.SetActive(true); GameoverPanel.GetComponent <GameoverDialog>().ShowData(); isStop = true; StopCoroutine(SpawnWaves()); StopCoroutine(RegenHealthbar()); GameObject[] enemies = GameObject.FindGameObjectsWithTag("Enemy"); for (int i = 0; i < enemies.Length; i++) { Destroy(enemies[i]); } } if (progressbar.GetComponent <ProgressbarController>().GetCurrentPoint() >= progressbar.GetComponent <ProgressbarController>().GetWinPoint3()) { isStop = true; if (PlayerDataUtils.playerData.highestLevelUnlocked <= LevelUtils.currentLevel.GetIndex()) { PlayerDataUtils.playerData.highestLevelUnlocked = LevelUtils.currentLevel.GetIndex() + 1; } GameObject[] enemy = GameObject.FindGameObjectsWithTag("Enemy"); for (int i = 0; i < enemy.Length; i++) { Destroy(enemy[i]); } PlayerDataUtils.saveData(); LevelUpPanel.SetActive(true); LevelUpPanel.GetComponent <LevelUpDialog>().ShowData(); StopCoroutine(SpawnWaves()); StopCoroutine(RegenHealthbar()); GameObject[] enemies = GameObject.FindGameObjectsWithTag("Enemy"); for (int i = 0; i < enemies.Length; i++) { Destroy(enemies[i]); } } }
private void Awake() { //加载三大管理器 this._BellyPointManager = gameObject.GetComponent <BellyPointManager>(); this._MoodPointManager = gameObject.GetComponent <MoodPointManager>(); this._FatiguePointManager = gameObject.GetComponent <FatiguePointManager>(); //加载视频管理器 //_MovieManager = GameObject.Find("MovieCamera").GetComponent<PlayClipManager>(); //加载UI管理器 _UIManager = GameObject.Find("Prograss_Panel").GetComponent <UIManager>(); //管理自动事件处理 playerDataUtils = PlayerDataUtils.getInstance(); playerDataUtils.test(); }
public void OnApplicationQuit() { PlayerDataUtils.saveData(); }
private void Awake() { //加载工具类 playerDataUtils = PlayerDataUtils.getInstance(); }
private string GetLogPath() { return(PlayerDataUtils.GetPersistentDataPath() + "/LogData/"); }
private void Awake() { //获取全局工具类对象. playerDataUtils = PlayerDataUtils.getInstance(); }