Пример #1
0
    void Start()
    {
        ShowKassen();

        BGMSESwitch bgm = new BGMSESwitch();

        bgm.StopSEVolume();
        bgm.StopBGMVolume();
    }
Пример #2
0
    public void Start()
    {
        Resources.UnloadUnusedAssets();
        GetLock();
        tutorialDoneFlg = PlayerPrefs.GetBool("tutorialDoneFlg");
        if (tutorialDoneFlg)
        {
            string userId = PlayerPrefs.GetString("userId");
            GetBanCount(userId);
        }
        fade = GameObject.Find("FadeCanvas").GetComponent <Fade>();

        /*Sound Controller Start*/
        if (GameObject.Find("BGMController") == null)
        {
            string     bgmPath = "Prefabs/Common/SoundController/BGMController";
            GameObject bgmObj  = Instantiate(Resources.Load(bgmPath)) as GameObject;
            bgmObj.name = "BGMController";
        }

        if (GameObject.Find("SEController") == null)
        {
            string     sePath = "Prefabs/Common/SoundController/SEController";
            GameObject seObj  = Instantiate(Resources.Load(sePath)) as GameObject;
            seObj.name = "SEController";
        }
        BGMSESwitch bgm = GetComponent <BGMSESwitch> ();

        bgm.StopSEVolume();
        bgm.StopBGMVolume();
        /*Sound Controller End*/

        string versionNo = Application.version;

        GameObject.Find("Ver").GetComponent <Text>().text = versionNo;
    }
Пример #3
0
    void Start()
    {
        GameScene gameSceneScript = new GameScene();

        //Sound
        BGMSESwitch bgm = new BGMSESwitch();

        bgm.StopSEVolume();
        bgm.StopKassenBGMVolume();

        //Taiko
        StartCoroutine("taikoMusic");

        //Kill Prevous BGM
        KillOtherBGM kill = new KillOtherBGM();

        kill.Start();

        //Giveup button
        bool isAttackedFlg = PlayerPrefs.GetBool("isAttackedFlg");

        if (isAttackedFlg)
        {
            GameObject.Find("GiveupBtn").SetActive(false);
        }

        //Auto button
        bool Auto2Flg = PlayerPrefs.GetBool("Auto2Flg");

        if (Auto2Flg)
        {
            GameObject.Find("AutoBtn").transform.FindChild("Num").GetComponent <Text>().text = "2";
            GameObject.Find("AutoBtn").GetComponent <AutoAttack>().speed = 2;
        }

        //Dinamic Map
        activeKuniId  = PlayerPrefs.GetInt("activeKuniId");
        activeStageId = PlayerPrefs.GetInt("activeStageId");
        GameObject wall = Instantiate(wallPrefab);

        wall.name = "wall";
        kaisenWeatherHandling(map);

        //Get Minus Status
        float rainMinusRatio = PlayerPrefs.GetFloat("rainMinusStatus", 0);
        float snowMinusRatio = PlayerPrefs.GetFloat("snowMinusStatus", 0);

        /*Player Setting*/
        int        jinkei      = PlayerPrefs.GetInt("jinkei", 0);
        List <int> myBusyoList = new List <int>();

        if (jinkei == 1)
        {
            soudaisyo = PlayerPrefs.GetInt("soudaisyo1");
            if (PlayerPrefs.HasKey("1map1"))
            {
                int mapId = 1;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map2"))
            {
                int mapId = 2;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map7"))
            {
                int mapId = 7;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map8"))
            {
                int mapId = 8;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map11"))
            {
                int mapId = 11;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map12"))
            {
                int mapId = 12;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map13"))
            {
                int mapId = 13;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map14"))
            {
                int mapId = 14;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map17"))
            {
                int mapId = 17;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map18"))
            {
                int mapId = 18;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map21"))
            {
                int mapId = 21;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map22"))
            {
                int mapId = 22;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
        }
        else if (jinkei == 2)
        {
            soudaisyo = PlayerPrefs.GetInt("soudaisyo2");

            if (PlayerPrefs.HasKey("2map3"))
            {
                int mapId = 3;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map4"))
            {
                int mapId = 4;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map5"))
            {
                int mapId = 5;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map7"))
            {
                int mapId = 7;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map8"))
            {
                int mapId = 8;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map11"))
            {
                int mapId = 11;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map12"))
            {
                int mapId = 12;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map17"))
            {
                int mapId = 17;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map18"))
            {
                int mapId = 18;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map23"))
            {
                int mapId = 23;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map24"))
            {
                int mapId = 24;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map25"))
            {
                int mapId = 25;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
        }
        else if (jinkei == 3)
        {
            soudaisyo = PlayerPrefs.GetInt("soudaisyo3");

            if (PlayerPrefs.HasKey("3map3"))
            {
                int mapId = 3;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map7"))
            {
                int mapId = 7;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map8"))
            {
                int mapId = 8;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map9"))
            {
                int mapId = 9;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map11"))
            {
                int mapId = 11;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map12"))
            {
                int mapId = 12;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map14"))
            {
                int mapId = 14;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map15"))
            {
                int mapId = 15;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map16"))
            {
                int mapId = 16;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map20"))
            {
                int mapId = 20;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map21"))
            {
                int mapId = 21;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map25"))
            {
                int mapId = 25;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
        }
        else if (jinkei == 4)
        {
            soudaisyo = PlayerPrefs.GetInt("soudaisyo4");

            if (PlayerPrefs.HasKey("4map1"))
            {
                int mapId = 1;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map2"))
            {
                int mapId = 2;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map7"))
            {
                int mapId = 7;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map8"))
            {
                int mapId = 8;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map12"))
            {
                int mapId = 12;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map13"))
            {
                int mapId = 13;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map14"))
            {
                int mapId = 14;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map18"))
            {
                int mapId = 18;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map19"))
            {
                int mapId = 19;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map20"))
            {
                int mapId = 20;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map24"))
            {
                int mapId = 24;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map25"))
            {
                int mapId = 25;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
        }

        //Saku
        BusyoInfoGet info     = new BusyoInfoGet();
        StatusGet    sts      = new StatusGet();
        GameObject   content  = GameObject.Find("Content").gameObject;
        string       slotPath = "Prefabs/Saku/Slot";
        Saku         saku     = new Saku();

        foreach (Transform n in content.transform)
        {
            GameObject.Destroy(n.gameObject);
        }

        foreach (int busyoId in myBusyoList)
        {
            List <string> sakuList = new List <string>();
            sakuList = saku.getSakuInfo(busyoId);

            if (saku.getSakuShipFlg(int.Parse(sakuList[0])))
            {
                GameObject slot     = Instantiate(Resources.Load(slotPath)) as GameObject;
                string     sakuPath = "Prefabs/Saku/saku" + sakuList[0];
                GameObject sakuIcon = Instantiate(Resources.Load(sakuPath)) as GameObject;
                sakuIcon.transform.SetParent(slot.transform);
                sakuIcon.transform.localScale            = new Vector2(0.45f, 0.45f);
                sakuIcon.GetComponent <Button>().enabled = false;

                slot.transform.SetParent(content.transform);
                slot.transform.localScale = new Vector2(1, 1);

                slot.GetComponent <Saku>().sakuId     = int.Parse(sakuList[0]);
                slot.GetComponent <Saku>().sakuEffect = int.Parse(sakuList[4]);

                if (sakuList[0] == "3")
                {
                    //hukuhei
                    //Heisyu
                    slot.GetComponent <Saku>().sakuHeisyu = info.getHeisyu(busyoId);
                    //Hei Status
                    string heiId   = "hei" + busyoId.ToString();
                    string chParam = PlayerPrefs.GetString(heiId, "0");
                    if (chParam == "0" || chParam == "")
                    {
                        StatusGet statusScript  = new StatusGet();
                        string    chParamHeisyu = statusScript.getHeisyu(busyoId);
                        chParam = chParamHeisyu + ":1:1:1";
                        PlayerPrefs.SetString(heiId, chParam);
                        PlayerPrefs.Flush();
                    }

                    char[]   delimiterChars = { ':' };
                    string[] ch_list        = chParam.Split(delimiterChars);
                    slot.GetComponent <Saku>().sakuHeiSts  = float.Parse(ch_list[3]);
                    slot.GetComponent <Saku>().sakuBusyoId = busyoId;

                    //Busyo Speed
                    int   sakuBusyoLv = PlayerPrefs.GetInt(busyoId.ToString());
                    float adjSpd      = (float)sts.getSpd(busyoId, sakuBusyoLv) / 10;
                    slot.GetComponent <Saku>().sakuBusyoSpeed = adjSpd;
                }
            }
        }

        //Nanban
        string        nanbanString = PlayerPrefs.GetString("nanbanItem");
        List <string> nanbanList   = new List <string>();

        char[] delimiterChars3 = { ',' };
        nanbanList = new List <string>(nanbanString.Split(delimiterChars3));

        for (int i = 0; i < nanbanList.Count; i++)
        {
            int qty = int.Parse(nanbanList[i]);
            if (qty != 0)
            {
                if (i == 0 || i == 1)
                {
                    GameObject slot = Instantiate(Resources.Load(slotPath)) as GameObject;

                    string nanbanPath = "";
                    if (i == 0)
                    {
                        nanbanPath = "Prefabs/Saku/saku8";
                    }
                    else if (i == 1)
                    {
                        nanbanPath = "Prefabs/Saku/saku9";
                    }

                    GameObject sakuIcon = Instantiate(Resources.Load(nanbanPath)) as GameObject;
                    sakuIcon.transform.SetParent(slot.transform);
                    sakuIcon.transform.localScale            = new Vector2(0.45f, 0.45f);
                    sakuIcon.GetComponent <Button>().enabled = false;

                    slot.transform.SetParent(content.transform);
                    slot.transform.localScale = new Vector2(1, 1);

                    if (i == 0)
                    {
                        slot.GetComponent <Saku>().sakuId = 8;
                    }
                    else if (i == 1)
                    {
                        slot.GetComponent <Saku>().sakuId = 9;
                    }
                    else if (i == 2)
                    {
                        slot.GetComponent <Saku>().sakuId = 10;
                    }

                    int      temp   = i + 1;
                    ItemInfo item   = new ItemInfo();
                    string   itemCd = "nanban" + temp.ToString();
                    int      effect = item.getItemEffect(itemCd);
                    slot.GetComponent <Saku>().sakuEffect = effect;
                }
            }
        }


        /*エネミー配置*/
        int linkNo = PlayerPrefs.GetInt("activeLink", 0);

        enemySoudaisyo = PlayerPrefs.GetInt("enemySoudaisyo");

        if (PlayerPrefs.HasKey("emap1"))
        {
            int mapId = 1;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap2"))
        {
            int mapId = 2;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap3"))
        {
            int mapId = 3;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap4"))
        {
            int mapId = 4;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap5"))
        {
            int mapId = 5;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap6"))
        {
            int mapId = 6;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap7"))
        {
            int mapId = 7;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap8"))
        {
            int mapId = 8;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap9"))
        {
            int mapId = 9;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap10"))
        {
            int mapId = 10;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap11"))
        {
            int mapId = 11;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap12"))
        {
            int mapId = 12;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap13"))
        {
            int mapId = 13;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap14"))
        {
            int mapId = 14;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap15"))
        {
            int mapId = 15;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap16"))
        {
            int mapId = 16;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap17"))
        {
            int mapId = 17;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap18"))
        {
            int mapId = 18;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap19"))
        {
            int mapId = 19;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap20"))
        {
            int mapId = 20;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap21"))
        {
            int mapId = 21;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap22"))
        {
            int mapId = 22;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap23"))
        {
            int mapId = 23;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap24"))
        {
            int mapId = 24;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap25"))
        {
            int mapId = 25;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }

        /*Dynamic Enemy Setting Finish*/
        //合戦開始エフェクト
        string     pathBack = "Prefabs/PreKassen/backGround";
        GameObject back     = Instantiate(Resources.Load(pathBack)) as GameObject;

        back.transform.localScale = new Vector2(30, 15);

        string     pathLight = "Prefabs/PreKassen/lightning";
        GameObject light     = Instantiate(Resources.Load(pathLight)) as GameObject;

        light.transform.localScale = new Vector2(10, 10);
    }