Example #1
0
    public void UserPartySave()
    {
        //파티 데이터 셋팅
        CharPartyList Node = new CharPartyList();

        Node.m_PartyListIndex = new int[4];

        for (int i = 0; i < 4; i++)
        {
            if (i < PartyList.Count)
            {
                Node.m_PartyListIndex[i] = PartyList[i].PartyIndex;
            }
            else
            {
                Node.m_PartyListIndex[i] = -1;
            }
        }

        string jsonData = JSON.JsonUtil.ToJson(Node);

        Debug.Log(jsonData);
        JSON.JsonUtil.CreateJson("UserPartyData", jsonData);
        //플레이어 파티 리스트
    }
Example #2
0
 public void PartySetting()
 {
     if (JSON.JsonUtil.FileCheck("UserPartyData"))
     {
         CharPartyList JsonData = JSON.JsonUtil.LoadJson <CharPartyList>("UserPartyData");
         for (int i = 0; i < 4; i++)
         {
             if (JsonData.m_PartyListIndex[i] != -1)
             {
                 int iCount = JsonData.m_PartyListIndex[i];
                 //플레이어 파티 셋팅
                 PartySetting(iCount);
             }
         }
         //파티 데이터 셋팅(유저의 인덱스 순서)
     }
 }
Example #3
0
    public void OnClick()
    {
        string strValue = m_InputFiled.transform.GetChild(1).GetComponent <UIInput>().value;

        if (strValue.Length < 8 && strValue.Length > 1)
        {
            //8자리 미만이다.
            if (!JSON.JsonUtil.FileCheck("UserNameData")) //현재 파일이 있는가?
            {
                UserNameData Node = new UserNameData();
                Node.m_strUserName = strValue;
                string jsonData = JSON.JsonUtil.ToJson(Node);
                Debug.Log(jsonData);
                JSON.JsonUtil.CreateJson("UserNameData", jsonData);
            }

            if (!JSON.JsonUtil.FileCheck("UserData")) //현재 파일이 있는가?
            {
                //없으면 데이터 생성
                //메인 캐릭터 라벨
                CharData[] Node = new CharData[1];
                Node[0]          = new CharData();
                Node[0].m_Level  = 1;
                Node[0].m_iIndex = 0;
                Node[0].m_CurEXP = 0;
                Node[0].m_eClass = CLASS.CLASS_THIEF;

                string jsonData = JSON.JsonUtil.ToJson <CharData>(Node);
                Debug.Log(jsonData);
                JSON.JsonUtil.CreateJson("UserData", jsonData);
                //플레이어 캐릭터 JSON
            }

            if (!JSON.JsonUtil.FileCheck("UserPartyData"))
            {
                CharPartyList Node = new CharPartyList();
                Node.m_PartyListIndex    = new int[4];
                Node.m_PartyListIndex[0] = 0;
                Node.m_PartyListIndex[1] = -1;
                Node.m_PartyListIndex[2] = -1;
                Node.m_PartyListIndex[3] = -1;

                string jsonData = JSON.JsonUtil.ToJson(Node);
                Debug.Log(jsonData);
                JSON.JsonUtil.CreateJson("UserPartyData", jsonData);
                //플레이어 캐릭터 JSON
            }

            if (!JSON.JsonUtil.FileCheck("UserMapData"))    //유저 맵 데이터
            {
                MapSaveData[] Node = new MapSaveData[3];

                for (int i = 0; i < 3; i++)
                {
                    Node[i] = new MapSaveData();
                    Node[i].m_bStageClear = false;
                }
                //현재는 맵이 세가지

                string jsonData = JSON.JsonUtil.ToJson <MapSaveData>(Node);
                Debug.Log(jsonData);
                JSON.JsonUtil.CreateJson("UserMapData", jsonData);
            }

            UserInfo.instance.Init();
            UserInfo.instance.PartySetting();
            GameManager.instance.Init();

            //플레이어 캐릭터 정보가 존재한다면 로딩
            LoadScene.SceneLoad("LobbyScene");
            //게임 씬 로딩
        }
    }