Пример #1
0
	public void OnClick(){

		string tmp = "kanni" + busyoId;
		PlayerPrefs.SetInt (tmp, kanniId);


		//Reduce from My Kanni
		string myKanni = PlayerPrefs.GetString("myKanni");
		List<string> myKanniList = new List<string> ();
		if(myKanni.Contains(",")){
			char[] delimiterChars = {','};
			myKanniList = new List<string> (myKanni.Split (delimiterChars));
		}else{
			myKanniList.Add(myKanni);
		}
		myKanniList.Remove (kanniId.ToString());

		string newMyKanni = "";
		for (int i=0; i<myKanniList.Count; i++) {
			if(i==0){
				newMyKanni = myKanniList[i];
			}else{
				newMyKanni = newMyKanni + "," + myKanniList[i];
			}
		}
		PlayerPrefs.SetString ("myKanni", newMyKanni);

		//Add Busyo Kanni
		string newMyKanniWithBusyo = "";
		string myKanniWithBusyo = PlayerPrefs.GetString ("myKanniWithBusyo");
		if (myKanniWithBusyo != null && myKanniWithBusyo != "") {
			newMyKanniWithBusyo = myKanniWithBusyo + "," + kanniId;
		} else {
			newMyKanniWithBusyo = kanniId.ToString();		
		}
		PlayerPrefs.SetString ("myKanniWithBusyo", newMyKanniWithBusyo);


		PlayerPrefs.Flush ();

		SyoguScene syogu = new SyoguScene();
		syogu.createSyoguView(busyoId);
		
		//Close Board
		CloseBoard close = new CloseBoard ();
		close.onClick();

	}
Пример #2
0
    public void OnClick()
    {
        /* New Equip Case*/
        //Reduce Available Kahou
        string temp = "available" + kahouType;
        string availableKahou = PlayerPrefs.GetString (temp);
        char[] delimiterChars = {','};
        string[] available_list = availableKahou.Split (delimiterChars);

        ArrayList newAvailableList = new ArrayList ();
        bool flag = false;

        for(int i=0;i<available_list.Length;i++){
            int tempKahouId = int.Parse(available_list[i]);

            if(kahouId==tempKahouId){
                if(flag==false){
                    flag = true;
                }else{
                    newAvailableList.Add(tempKahouId);
                }
            }else{
                newAvailableList.Add(tempKahouId);
            }
        }

        //Set String
        string kahouForData="";
        for(int j=0;j<newAvailableList.Count;j++){
            if(j != newAvailableList.Count-1){
                kahouForData = kahouForData + newAvailableList[j] + ",";
            }else{
                kahouForData = kahouForData + newAvailableList[j];
            }
        }

        //Attach Kaho to Busyo
        GameObject mainController = GameObject.Find ("GameScene");
        string busyoId = mainController.GetComponent<NowOnBusyo>().OnBusyo;
        string tempBusyo = "kahou" + busyoId;
        string busyoKahou = PlayerPrefs.GetString (tempBusyo);

        //Sample "0,1,0,0,0,0,0,0"
        int target = 999999;
        if(kahouType=="Bugu"){
            target = 0;
        }else if(kahouType=="Kabuto"){
            target = 1;
        }else if(kahouType=="Gusoku"){
            target = 2;
        }else if(kahouType=="Meiba"){
            target = 3;
        }else if(kahouType=="Cyadougu"){
            if(mainController.GetComponent<NowOnButton>().onKahouButton == "ItemCyadougu1"){
                target = 4;
            }else{
                target = 5;
            }
        }else if(kahouType=="Heihousyo"){
            target = 6;
        }else if(kahouType=="Chishikisyo"){
            target = 7;
        }
        string kahouBusyoId="";
        string[] busyoKahouList = busyoKahou.Split (delimiterChars);
        for(int k=0; k<busyoKahouList.Length;k++){
            string previousKahou = busyoKahouList[k];

            if(k == target){
                //Replace
                if(k != busyoKahouList.Length-1){
                    kahouBusyoId = kahouBusyoId + kahouId + ",";
                }else{
                    kahouBusyoId = kahouBusyoId + kahouId;
                }
            }else{
                //Add directol y
                if(k != busyoKahouList.Length-1){
                    kahouBusyoId = kahouBusyoId + previousKahou + ",";

                }else{
                    kahouBusyoId = kahouBusyoId + previousKahou;
                }
            }
        }

        //Reduce Available Kaho & Busyo Kahoy

        PlayerPrefs.SetString (temp,kahouForData);
        PlayerPrefs.SetString (tempBusyo,kahouBusyoId);
        PlayerPrefs.Flush();

        //ReCall as Initialization
        KahouScene kaho = new KahouScene();
        kaho.createKahouStatusView(busyoId);

        //Close Board
        CloseBoard close = new CloseBoard ();
        close.onClick();
    }
Пример #3
0
    // Use this for initialization
    public void OnClick()
    {
        AudioSource[] audioSources = GameObject.Find("SEController").GetComponents <AudioSource> ();
        audioSources [4].Play();

        string kahouTypeTemp = "";

        /* unEquip Case*/
        //Add Available Kahou
        if (kahouType == "bugu")
        {
            kahouTypeTemp = "Bugu";
        }
        else if (kahouType == "kabuto")
        {
            kahouTypeTemp = "Kabuto";
        }
        else if (kahouType == "gusoku")
        {
            kahouTypeTemp = "Gusoku";
        }
        else if (kahouType == "meiba")
        {
            kahouTypeTemp = "Meiba";
        }
        else if (kahouType == "cyadougu")
        {
            kahouTypeTemp = "Cyadougu";
        }
        else if (kahouType == "heihousyo")
        {
            kahouTypeTemp = "Heihousyo";
        }
        else if (kahouType == "chishikisyo")
        {
            kahouTypeTemp = "Chishikisyo";
        }

        string temp           = "available" + kahouTypeTemp;
        string availableKahou = PlayerPrefs.GetString(temp);

        if (availableKahou == null || availableKahou == "")
        {
            availableKahou = kahouId.ToString();
        }
        else
        {
            availableKahou = availableKahou + "," + kahouId.ToString();
        }

        /*Reduce Busyo Kaho Start*/
        GameObject mainController = GameObject.Find("GameScene");
        string     busyoId        = mainController.GetComponent <NowOnBusyo>().OnBusyo;
        string     tempBusyo      = "kahou" + busyoId;
        string     busyoKahou     = PlayerPrefs.GetString(tempBusyo);

        int target = 999999;

        if (kahouTypeTemp == "Bugu")
        {
            target = 0;
        }
        else if (kahouTypeTemp == "Kabuto")
        {
            target = 1;
        }
        else if (kahouTypeTemp == "Gusoku")
        {
            target = 2;
        }
        else if (kahouTypeTemp == "Meiba")
        {
            target = 3;
        }
        else if (kahouTypeTemp == "Cyadougu")
        {
            if (mainController.GetComponent <NowOnButton>().onKahouButton == "ItemCyadougu1")
            {
                target = 4;
            }
            else
            {
                target = 5;
            }
        }
        else if (kahouTypeTemp == "Heihousyo")
        {
            target = 6;
        }
        else if (kahouTypeTemp == "Chishikisyo")
        {
            target = 7;
        }
        string kahouBusyoId = "";

        char[]   delimiterChars = { ',' };
        string[] busyoKahouList = busyoKahou.Split(delimiterChars);
        for (int k = 0; k < busyoKahouList.Length; k++)
        {
            string previousKahou = busyoKahouList[k];

            if (k == target)
            {
                //Replace
                if (k != busyoKahouList.Length - 1)
                {
                    kahouBusyoId = kahouBusyoId + "0,";
                }
                else
                {
                    kahouBusyoId = kahouBusyoId + "0";
                }
            }
            else
            {
                //Add directoly
                if (k != busyoKahouList.Length - 1)
                {
                    kahouBusyoId = kahouBusyoId + previousKahou + ",";
                }
                else
                {
                    kahouBusyoId = kahouBusyoId + previousKahou;
                }
            }
        }
        /*Reduce Busyo Kaho End*/


        //Data Registration of Available Kaho & Busyo Kahou
        PlayerPrefs.SetString(temp, availableKahou);
        PlayerPrefs.SetString(tempBusyo, kahouBusyoId);
        PlayerPrefs.Flush();

        //ReCall as Initialization
        KahouScene kaho = new KahouScene();

        kaho.createKahouStatusView(busyoId);

        //Close Board
        CloseBoard close = new CloseBoard();

        close.onClick();
    }
Пример #4
0
    public void OnClick()
    {
        AudioSource[] audioSources = GameObject.Find("SEController").GetComponents <AudioSource> ();
        audioSources [3].Play();

        string tmp = "kanni" + busyoId;

        PlayerPrefs.SetInt(tmp, kanniId);


        //Reduce from My Kanni
        string        myKanni     = PlayerPrefs.GetString("myKanni");
        List <string> myKanniList = new List <string> ();

        if (myKanni.Contains(","))
        {
            char[] delimiterChars = { ',' };
            myKanniList = new List <string> (myKanni.Split(delimiterChars));
        }
        else
        {
            myKanniList.Add(myKanni);
        }
        myKanniList.Remove(kanniId.ToString());

        string newMyKanni = "";

        for (int i = 0; i < myKanniList.Count; i++)
        {
            if (i == 0)
            {
                newMyKanni = myKanniList[i];
            }
            else
            {
                newMyKanni = newMyKanni + "," + myKanniList[i];
            }
        }
        PlayerPrefs.SetString("myKanni", newMyKanni);

        //Add Busyo Kanni
        string newMyKanniWithBusyo = "";
        string myKanniWithBusyo    = PlayerPrefs.GetString("myKanniWithBusyo");

        if (myKanniWithBusyo != null && myKanniWithBusyo != "")
        {
            newMyKanniWithBusyo = myKanniWithBusyo + "," + kanniId;
        }
        else
        {
            newMyKanniWithBusyo = kanniId.ToString();
        }
        PlayerPrefs.SetString("myKanniWithBusyo", newMyKanniWithBusyo);

        PlayerPrefs.SetBool("questSpecialFlg8", true);
        PlayerPrefs.Flush();

        SyoguScene syogu = new SyoguScene();

        syogu.createSyoguView(busyoId);

        //Close Board
        CloseBoard close = new CloseBoard();

        close.onClick();
    }
Пример #5
0
    public void OnClick()
    {
        AudioSource[] audioSources = GameObject.Find("SEController").GetComponents <AudioSource> ();
        audioSources [3].Play();

        /* New Equip Case*/
        //Reduce Available Kahou
        string temp           = "available" + kahouType;
        string availableKahou = PlayerPrefs.GetString(temp);

        char[]   delimiterChars = { ',' };
        string[] available_list = availableKahou.Split(delimiterChars);

        ArrayList newAvailableList = new ArrayList();
        bool      flag             = false;

        for (int i = 0; i < available_list.Length; i++)
        {
            int tempKahouId = int.Parse(available_list[i]);

            if (kahouId == tempKahouId)
            {
                if (flag == false)
                {
                    flag = true;
                }
                else
                {
                    newAvailableList.Add(tempKahouId);
                }
            }
            else
            {
                newAvailableList.Add(tempKahouId);
            }
        }

        //Set String
        string kahouForData = "";

        for (int j = 0; j < newAvailableList.Count; j++)
        {
            if (j != newAvailableList.Count - 1)
            {
                kahouForData = kahouForData + newAvailableList[j] + ",";
            }
            else
            {
                kahouForData = kahouForData + newAvailableList[j];
            }
        }

        //Attach Kaho to Busyo
        GameObject mainController = GameObject.Find("GameScene");
        string     busyoId        = mainController.GetComponent <NowOnBusyo>().OnBusyo;
        string     tempBusyo      = "kahou" + busyoId;
        string     busyoKahou     = PlayerPrefs.GetString(tempBusyo);

        //Sample "0,1,0,0,0,0,0,0"
        int target = 999999;

        if (kahouType == "Bugu")
        {
            target = 0;
        }
        else if (kahouType == "Kabuto")
        {
            target = 1;
        }
        else if (kahouType == "Gusoku")
        {
            target = 2;
        }
        else if (kahouType == "Meiba")
        {
            target = 3;
        }
        else if (kahouType == "Cyadougu")
        {
            if (mainController.GetComponent <NowOnButton>().onKahouButton == "ItemCyadougu1")
            {
                target = 4;
            }
            else
            {
                target = 5;
            }
        }
        else if (kahouType == "Heihousyo")
        {
            target = 6;
        }
        else if (kahouType == "Chishikisyo")
        {
            target = 7;
        }
        string kahouBusyoId = "";

        string[] busyoKahouList = busyoKahou.Split(delimiterChars);
        for (int k = 0; k < busyoKahouList.Length; k++)
        {
            string previousKahou = busyoKahouList[k];

            if (k == target)
            {
                //Replace
                if (k != busyoKahouList.Length - 1)
                {
                    kahouBusyoId = kahouBusyoId + kahouId + ",";
                }
                else
                {
                    kahouBusyoId = kahouBusyoId + kahouId;
                }
            }
            else
            {
                //Add directol y
                if (k != busyoKahouList.Length - 1)
                {
                    kahouBusyoId = kahouBusyoId + previousKahou + ",";
                }
                else
                {
                    kahouBusyoId = kahouBusyoId + previousKahou;
                }
            }
        }

        //Reduce Available Kaho & Busyo Kahoy

        PlayerPrefs.SetString(temp, kahouForData);
        PlayerPrefs.SetString(tempBusyo, kahouBusyoId);
        PlayerPrefs.SetBool("questSpecialFlg7", true);

        PlayerPrefs.Flush();

        //ReCall as Initialization
        KahouScene kaho = new KahouScene();

        kaho.createKahouStatusView(busyoId);

        //Close Board
        CloseBoard close = new CloseBoard();

        close.onClick();
    }
Пример #6
0
    // Use this for initialization
    public void OnClick()
    {
        string kahouTypeTemp = "";

        /* unEquip Case*/
        //Add Available Kahou
        if(kahouType=="bugu"){
            kahouTypeTemp ="Bugu";
        }else if(kahouType=="kabuto"){
            kahouTypeTemp ="Kabuto";
        }else if(kahouType=="gusoku"){
            kahouTypeTemp ="Gusoku";
        }else if(kahouType=="meiba"){
            kahouTypeTemp ="Meiba";
        }else if(kahouType=="cyadougu"){
            kahouTypeTemp ="Cyadougu";
        }else if(kahouType=="heihousyo"){
            kahouTypeTemp ="Heihousyo";
        }else if(kahouType=="chishikisyo"){
            kahouTypeTemp ="Chishikisyo";
        }

        string temp = "available" + kahouTypeTemp;
        string availableKahou = PlayerPrefs.GetString (temp);

        if (availableKahou == null || availableKahou == "") {
            availableKahou = kahouId.ToString();
        } else {
            availableKahou = availableKahou + "," + kahouId.ToString();
        }

        /*Reduce Busyo Kaho Start*/
        GameObject mainController = GameObject.Find ("GameScene");
        string busyoId = mainController.GetComponent<NowOnBusyo>().OnBusyo;
        string tempBusyo = "kahou" + busyoId;
        string busyoKahou = PlayerPrefs.GetString (tempBusyo);

        int target = 999999;
        if(kahouTypeTemp=="Bugu"){
            target = 0;
        }else if(kahouTypeTemp=="Kabuto"){
            target = 1;
        }else if(kahouTypeTemp=="Gusoku"){
            target = 2;
        }else if(kahouTypeTemp=="Meiba"){
            target = 3;
        }else if(kahouTypeTemp=="Cyadougu"){
            if(mainController.GetComponent<NowOnButton>().onKahouButton == "ItemCyadougu1"){
                target = 4;
            }else{
                target = 5;
            }
        }else if(kahouTypeTemp=="Heihousyo"){
            target = 6;
        }else if(kahouTypeTemp=="Chishikisyo"){
            target = 7;
        }
        string kahouBusyoId="";
        char[] delimiterChars = {','};
        string[] busyoKahouList = busyoKahou.Split (delimiterChars);
        for(int k=0; k<busyoKahouList.Length;k++){
            string previousKahou = busyoKahouList[k];

            if(k == target){
                //Replace
                if(k != busyoKahouList.Length-1){
                    kahouBusyoId = kahouBusyoId + "0,";
                }else{
                    kahouBusyoId = kahouBusyoId + "0";
                }
            }else{
                //Add directoly
                if(k != busyoKahouList.Length-1){
                    kahouBusyoId = kahouBusyoId + previousKahou + ",";

                }else{
                    kahouBusyoId = kahouBusyoId + previousKahou;
                }
            }
        }
        /*Reduce Busyo Kaho End*/

        //Data Registration of Available Kaho & Busyo Kahou
        PlayerPrefs.SetString (temp,availableKahou);
        PlayerPrefs.SetString (tempBusyo,kahouBusyoId);
        PlayerPrefs.Flush();

        //ReCall as Initialization
        KahouScene kaho = new KahouScene();
        kaho.createKahouStatusView(busyoId);

        //Close Board
        CloseBoard close = new CloseBoard ();
        close.onClick();
    }