コード例 #1
0
 public void OnApplicationFocus(bool focusStatus)
 {
     if (!focusStatus)
     {
         PlayerDataUtils.saveData();
     }
 }
コード例 #2
0
    private void Awake()
    {
        //Debug.Log("脚本本身的启动与关闭。。。。");

        //实例化工具类(单例)
        playerDataUtils = PlayerDataUtils.getInstance();
    }
コード例 #3
0
 public void Play()
 {
     PlayerDataUtils.loadData();
     LevelUtils.currentLevel = LevelUtils.GetLevel(PlayerDataUtils.playerData.currentLevelIndex);
     SceneManager.LoadScene("Play");
     Done_GameController.instance.Start();
 }
コード例 #4
0
 void OnNextButtonClick()
 {
     PlayerDataUtils.playerData.currentLevelIndex = PlayerDataUtils.playerData.currentLevelIndex + 1;
     LevelUtils.currentLevel = LevelUtils.GetLevel(PlayerDataUtils.playerData.currentLevelIndex);
     PlayerDataUtils.saveData();
     SceneManager.LoadScene("Play");
     gameObject.SetActive(false);
 }
コード例 #5
0
 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");
 }
コード例 #6
0
 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);
 }
コード例 #7
0
ファイル: PlayerDataUtils.cs プロジェクト: Ruxer/CatGirl2019
 public static PlayerDataUtils getInstance()
 {
     if (instance == null)
     {
         instance   = new PlayerDataUtils();
         playerData = Resources.Load <PlayerData>("PlayerData");
         designData = Resources.Load <DesignData>("DesignData");
     }
     return(instance);
 }
コード例 #8
0
    // 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);
        }
    }
コード例 #9
0
 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]);
         }
     }
 }
コード例 #10
0
ファイル: ObsererManager.cs プロジェクト: Ruxer/CatGirl2019
    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();
    }
コード例 #11
0
 public void OnApplicationQuit()
 {
     PlayerDataUtils.saveData();
 }
コード例 #12
0
 private void Awake()
 {
     //加载工具类
     playerDataUtils = PlayerDataUtils.getInstance();
 }
コード例 #13
0
 private string GetLogPath()
 {
     return(PlayerDataUtils.GetPersistentDataPath() + "/LogData/");
 }
コード例 #14
0
ファイル: MoodPointManager.cs プロジェクト: Ruxer/CatGirl2019
 private void Awake()
 {
     //获取全局工具类对象.
     playerDataUtils = PlayerDataUtils.getInstance();
 }