Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        //10秒に一回差分を見て侍作成
        timer += Time.deltaTime;

        if (timer >= 10)
        {
            int createChara = 0;

            //現在時間
            DateTime currentDate = DateTime.Now;
            //昔の時間
            long tick = SaveDataBase.GetClose_Timer();
            //差分
            long     elapsedTicks = currentDate.Ticks - tick;
            TimeSpan elapsedSpan  = new TimeSpan(elapsedTicks);
            //何分経過したかわかる
            int minute = (int)elapsedSpan.TotalMinutes;

            if (minute >= 1)
            {
                //1分で3人増えますよ
                createChara = minute * 3;
                //一回作ったらタイマー保存
                SaveDataBase.SetClose_Timer();
                CharacterManager.getInstance().characterAdd(createChara);
            }
        }
    }
    // Use this for initialization
    void Awake()
    {
        // SaveDataを開く
        SaveDataBase.loadData();

        iClearFlag = DataBase.PLAY;
        //iClearFlag = 0;

        this.STAR_COUNT = 0;

        this.bNekomaruObj.SetActive(true);
        this.bStageClearObj.SetActive(false);
        this.bStageClearEfectObj.SetActive(false);
        this.bStageMissObj.SetActive(false);

        //クリア時の星の表示(星を未取得の設定)
        ImgStar1.color = new Color(200 / 255f, 200 / 255f, 200 / 255f, 113 / 255f);
        ImgStar2.color = new Color(200 / 255f, 200 / 255f, 200 / 255f, 113 / 255f);
        ImgStar3.color = new Color(200 / 255f, 200 / 255f, 200 / 255f, 113 / 255f);

        textStage.text = "Level " + LoadStage.now_stage;

        main = this;

        Debug.Log("LoadStage.nowStage:" + LoadStage.now_stage + "DataBase.nowStage:" + DataBase.nowStage + "openLevel:" + DataBase.openLevel);
    }
Exemple #3
0
    //作成可能なキャラ数
    void Start()
    {
        //ゲームのセーブロード
        SaveDataBase.loadData();

        int createChara = 0;

        //初回か?
        if (SaveDataBase.GetSamurai_All() == 0)
        {
            //初期化
            SaveDataBase.InitSaveData();
            createChara = (int)SaveDataBase.GetSamuraiNum();
            //初回タイマー保存
            SaveDataBase.SetClose_Timer();
        }
        else
        {
            //アプリ終了前に徘徊している侍
            createChara = SaveDataBase.GetSamuraiNum();
        }


        CharacterManager.getInstance().characterAdd(createChara);
        //ステータス表示の更新
        UIStatus.getInstance().upDataText();
    }
Exemple #4
0
    // Use this for initialization
    void Awake()
    {
        // SaveDataを開く
        SaveDataBase.loadData();

        Debug.Log("解放したレベル:" + DataBase.openLevel);

        for (int i = 0; i < 10; i++)
        {
            if (i < DataBase.openLevel)
            {
                level [i].SetActive(true);
            }
            else
            {
                level [i].SetActive(false);
            }
        }

        int star = 0;

        for (int i = 0; i < DataBase.openLevel; i++)
        {
            star += DataBase.level_star [i];
        }

        starsAll_text.text = star + "/30";
    }
        public void LoadData(SaveDataBase saveData)
        {
            PlayerSaveData playerData = (PlayerSaveData)saveData;

            if (playerData == null)
            {
                return;
            }

            Transform playerTransform = transform;

            playerTransform.position = playerData.Position;
            playerTransform.rotation = playerData.Rotation;

            Health.SetCurrentHealth(playerData.CurrentHealth);

            foreach (ItemSaveData itemSaveData in playerData.ItemList)
            {
                ItemScriptable item = InventoryReferencer.Instance.GetItemReference(itemSaveData.Name);
                Inventory.AddItem(item, itemSaveData.Amount);
            }

            WeaponScriptable weapon = (WeaponScriptable)Inventory.FindItem(playerData.EquippedWeaponData.Name);

            if (!weapon)
            {
                return;
            }

            weapon.weaponStats = playerData.EquippedWeaponData.WeaponStats;
            WeaponHolder.EquipWeapon(weapon);
        }
Exemple #6
0
        public void LoadData(SaveDataBase saveData)
        {
            SpawnerSaveData spawnerSaveData = (SpawnerSaveData)saveData;

            //StateMachine.Initialize(spawnerSaveData.CurrentState);
            //Initialized = true;
            StartingState = spawnerSaveData.CurrentState;
        }
    public static void Load(ISavable savable)
    {
        BinaryFormatter bf = new BinaryFormatter();

        Stream       stream = new FileStream(SAVE_BASE_PATH + savable.GetDefaultFileName(), FileMode.Open);
        SaveDataBase save   = (SaveDataBase)bf.Deserialize(stream);

        savable.LoadSaveData(save);
    }
Exemple #8
0
        public override async Task Execute(string[] args, SocketMessage message)
        {
            await message.Channel.SendMessageAsync("", false, EmbedUtil.GetEmbed("Saving database then yeeting myself"));

            SaveDataBase x = new SaveDataBase();
            await x.Execute(args, message);

            System.Environment.Exit(0);
        }
Exemple #9
0
    public void Awake()
    {
        // SaveDataを開く
        SaveDataBase.loadData();

        starsObtained = DataBase.level_star [stage_no - 1];
        Debug.Log("level:" + stage_no + " star:" + starsObtained);

        ImgStar1.color = new Color(255 / 255f, 0 / 255f, 0 / 255f);
        ImgStar2.color = new Color(255 / 255f, 0 / 255f, 0 / 255f);
        ImgStar3.color = new Color(255 / 255f, 0 / 255f, 0 / 255f);

        for (int i = 0; i < 3; i++)
        {
            switch (i)
            {
            case 0:
                if (1 <= starsObtained)
                {
                    ImgStar1.color = new Color(254 / 255f, 207 / 255f, 88 / 255f);
                }
                else
                {
                    ImgStar1.color = new Color(0 / 255f, 0 / 255f, 0 / 255f, 70 / 255f);
                }
                break;

            case 1:
                if (2 <= starsObtained)
                {
                    ImgStar2.color = new Color(254 / 255f, 207 / 255f, 88 / 255f);
                }
                else
                {
                    ImgStar2.color = new Color(0 / 255f, 0 / 255f, 0 / 255f, 70 / 255f);
                }
                break;

            case 2:
                if (3 <= starsObtained)
                {
                    ImgStar3.color = new Color(254 / 255f, 207 / 255f, 88 / 255f);
                }
                else
                {
                    ImgStar3.color = new Color(0 / 255f, 0 / 255f, 0 / 255f, 70 / 255f);
                }
                break;
            }
        }
    }
    // Update is called once per frame
    void Update()
    {
        if (iClearFlag == DataBase.CLEAR)
        {
            //Debug.Log ("game clear test");

            textStar.text = "×" + STAR_COUNT;
            bNekomaruObj.SetActive(false);
            bStageClearObj.SetActive(true);
            bStageClearEfectObj.SetActive(true);
            bStageMissObj.SetActive(false);

            //クリアの設定
            if (DataBase.nowStage == DataBase.openLevel)
            {
                Debug.Log("クリアは同じレベルだよ");

                if (DataBase.openLevel < 10)
                {
                    DataBase.openLevel++;
                }
            }

            //レベルの星の数のレコード更新
            if (DataBase.level_star [DataBase.nowStage - 1] < STAR_COUNT)
            {
                DataBase.level_star [DataBase.nowStage - 1] = STAR_COUNT;
            }

            //繰り返し実行しないようにフラグを変える
            iClearFlag = DataBase.CLEAR_AFTER;

            // SaveDataを保存
            SaveDataBase.saveData();
        }
        else if (iClearFlag == DataBase.MISS)
        {
            Debug.Log("game over test");

            bNekomaruObj.SetActive(false);
            bStageClearObj.SetActive(false);
            bStageClearEfectObj.SetActive(false);

            bStageMissObj.SetActive(true);
        }
    }
Exemple #11
0
    void ListUpdate()
    {
        int kind = SaveDataBase.GetSamurai_Kind();

        for (int i = 0; i < DataBase.MAX_KIND; i++)
        {
            int val = kind & (int)System.Math.Pow(2, i);
            if (val >= 1)
            {
                scrollObjList[i].OnWindow(i);
            }
            else
            {
                scrollObjList[i].OffWindow();
            }
        }
    }
Exemple #12
0
    void OnGUI()
    {
        float baseY   = 0;
        float baseAdd = 0;

        baseAdd += 20;
        if (GUI.Button(new Rect(10, baseY + baseAdd, 210, 20), "データリセット"))
        {
            SaveDataBase.InitSaveData();
            SaveDataBase.saveData();
            Application.LoadLevel("main");
        }
        baseAdd += 20;
        if (GUI.Button(new Rect(10, baseY + baseAdd, 210, 20), "デバックオフ "))
        {
            Destroy(gameObject);
        }
    }
Exemple #13
0
    void DeadEnd()
    {
        //アニメーションを戻します
        spriteChara.SetBool("Return", true);
        for (int i = 0; i < DataBase.MAX_KIND; i++)
        {
            spriteChara.SetBool("Chara" + kind, false);
        }


        //点数が入ります
        SaveDataBase.AddSamurai_All(DataBase.Scores[kind - 1]);


        SaveDataBase.AddSamurai_Kind(kind);

        gameObject.SetActive(false);
        iTween.Stop(gameObject);
    }
Exemple #14
0
 public void AddSaveData(SaveDataBase saveData)
 {
     saveDatas.Add(saveData);
 }
 public bool LoadSaveData(SaveDataBase data)
 {
     CurrentHatID = ((CharacterAestheticsSaveData)data).HatId;
     return(true);
 }
Exemple #16
0
 //アプリ終了
 void OnApplicationQuit()
 {
     //はいかいしている侍 保存
     SaveDataBase.SetSamuraiNum(CharacterManager.getInstance().getCharaNum());
     SaveDataBase.saveData();
 }
 public bool LoadSaveData(SaveDataBase data)
 {
     throw new NotImplementedException();
 }
Exemple #18
0
 public void upDataText()
 {
     //合計数
     scoreText.text = SaveDataBase.GetSamurai_All() + "侍";
 }