진위여부 확인 안됨

유니티에서의 TMP_InputField와 TMP_Text의 text 반환값은 모두 string 타입이지만, InputField에서 반환되는 text는 사용자가 입력한 값만을 포함하고, TMP_Text의 text는 추가적으로 포매팅이나 스타일에 대한 정보를 포함할 수 있습니다. 이는 TMP_Text에서 텍스트를 처리하는 방식과 관련되어 있습니다.

사용자가 "5004"라는 값을 입력했더라도, TMP_Text의 text 값을 가져오면 "\u200B5004" 또는 "5004\u200B"와 같이 보이지 않는 특수 문자가 포함된 문자열을 얻을 수 있습니다. 이 경우, int로 변환하는 과정에서 FormatException이 발생할 수 있습니다. 이는 int.Parse 또는 int.TryParse 메서드가 숫자 이외의 문자를 포함한 문자열을 int로 변환할 수 없기 때문입니다.

이 문제를 해결하려면, TMP_Text의 text에서 숫자만 추출하여 int로 변환하는 것이 필요합니다. 이를 위해서는 정규 표현식 등을 사용하여 숫자만 추출할 수 있습니다.

string inputString = _text.text;
string cleanedString = System.Text.RegularExpressions.Regex.Replace(inputString, "[^0-9]", "");

int stageIDX;
if (int.TryParse(cleanedString, out stageIDX))
{
    // stageIDX 사용 가능
}
else
{
    Debug.LogError($"Failed to parse {_text.text} to int");
}

이 코드는 _text.text에서 숫자 이외의 문자를 모두 제거한 후, 그 결과 문자열을 int로 변환하려고 시도합니다. 숫자 이외의 문자를 제거하는 것이 필요한 경우에 유용하게 사용될 수 있습니다.

블로그 이미지

RIsN

,
[Stations In Seoul] Devlog #7

Download: Under Construction

Dear players,

Welcome to the 7th installment of the development diary for 'Stations in Seoul'. As the sole developer of this project, your continued support and enthusiasm fuel my endeavors and inspire me to push the boundaries of this game. Today, I have some critical updates to share with you.

First and foremost, I am in the process of modifying the card User Experience (UX). It's an intensive task, but I am committed to ensuring that this change will elevate your in-game interaction and overall experience.

Additionally, I am excited to share that the development of additional storyline and journal features is ongoing. These elements will enrich the narrative of the game and offer you a more immersive experience.

While progress is taking slightly longer than anticipated, rest assured, I am dedicating my best efforts towards crafting a unique and engaging game. My hope is to present a prototype to you in August.

As always, your feedback remains invaluable to me. It helps steer the development of 'Stations in Seoul' in the right direction and ensures the game will meet your expectations.

Thank you for your unwavering support and patience. Stay tuned for more updates!

Best,
Future Cat Labs

Creator

Patreon Link

블로그 이미지

RIsN

,
[Find with Seoul] Devlog #14

Download: GooglePlay / Steam

Dear players,

Exciting news! I'm thrilled to share the 14th installment of the Find with Seoul development diary. Your continued support and feedback have been invaluable in shaping this game, and I can't thank you enough.

I've been hard at work, adding resolution options to the game. Though it has proven a bit of a challenge, I'm confident that this new feature will significantly enhance your gameplay experience.

Furthermore, I'm delighted to announce the addition of Spanish to the language options in the game. This has been a substantial undertaking, and I hope this brings a more inclusive and accessible experience for our Spanish-speaking players.

In addition to these enhancements, rest assured that the crafting of captivating storylines continues. Developing the narratives is an ongoing process, and I'm excited about the progress made so far.

Your feedback continues to be instrumental in the game's improvement. I eagerly anticipate hearing your thoughts and suggestions.

Thank you again for your unwavering support for Find with Seoul. Stay tuned for more updates on our journey together.

Best,
Future Cat Labs

Creator

Patreon Link

블로그 이미지

RIsN

,
[Stations In Seoul] Devlog #6

Download: Under Construction

Hello,

Welcome to the sixth installment of our development diary for the upcoming game, Stations in Seoul. As the sole developer, your support continues to fuel my progress and motivate my journey in crafting this game. Today, I have several key updates to share.

Firstly, in the pursuit of delivering a seamless gaming experience, I have been diligently working on identifying and rectifying bugs in certain problematic areas of the game. This has been a significant task, but an essential one.

Additionally, to enhance the game's overall development, I am focusing on improving the development tools. While this is time-consuming, it's a crucial step that will lead to a smoother and more efficient development process in the long run.

I am also working on assigning individual skills to the zombies in the game. This is an exciting step that promises to make the gameplay experience more engaging and challenging, adding a new layer of depth to Stations in Seoul.

As always, your feedback is invaluable in this journey. It helps me refine the game and steer its development in the right direction. I'm grateful for your ongoing support and look forward to hearing your thoughts on the progress made.

Thank you and stay tuned for more updates!

Best,
Future Cat Labs

Creator

Patreon Link

블로그 이미지

RIsN

,
[Find with Seoul] Devlog #13

Download: GooglePlay / Steam

Dear players,

I'm thrilled to share the 13th installment of the Find with Seoul development diary. As the sole developer, your constant engagement and support have been fundamental in shaping this game, and I can't express my appreciation enough.

At present, I'm hard at work implementing new option features to the game. This task has proven to be more complex than anticipated, but I'm confident that the enhancements will greatly improve your gaming experience. I can't wait to show you what's coming soon.

In addition to this, I'm also crafting new storylines to further enrich the Find with Seoul universe. The creation of captivating narratives is an ongoing process, and I'm excited about the progress made so far.

Your feedback continues to be invaluable, playing a vital role in refining and improving the game. Please keep your thoughts and comments coming.

Thank you once again for your continued dedication and support. I eagerly look forward to continuing this development journey with you.

Best,
Future Cat Labs

Creator

Patreon Link

블로그 이미지

RIsN

,

봉골레 쇼유라멘

  • 바질도 그랬지만 스프랑 면이 잘 안맞는 느낌
  • 가성비 모름(얻어먹음)
  • 포만감 평범
  • 조금 느끼한 맛이 있음, 만두 맛있음

Version 1.2
→ Version 1.3: ???

블로그 이미지

RIsN

,
  • 저장용
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
using Newtonsoft.Json;

public class ModuleDataDownloadTable : MonoBehaviour
{
    // Constants used for API call
    private const string KeyTable = "여기에 전체 공유된 구글 스프레드시트 번호 넣기";
    private const string KeyAuth = "여기에 구글 스프레드시트 인증 넣기(참고: https://ajh322.tistory.com/247)";
    private const string UrlFormat = "https://sheets.googleapis.com/v4/spreadsheets/{0}/values/{1}?key={2}";

    // Initialization method
    public void Init()
    {
    }

    // Coroutine for downloading table data
    public IEnumerator DownloadTable(string tableName, System.Action<string> afterAction)
    {
        Debug.LogWarning($":: Download Table : {tableName} Start");

        // Create a new web request with the appropriate URL
        using UnityWebRequest req = UnityWebRequest.Get(PickURL(tableName));
        yield return req.SendWebRequest();

        // Handle potential request errors
        if (req.result == UnityWebRequest.Result.ConnectionError || req.result == UnityWebRequest.Result.ProtocolError)
        {
            Debug.LogError(req.error);
            yield break;
        }

        // Deserialize the response and convert to JSON
        string[][] values = DeserializeResponse(req.downloadHandler.text);
        afterAction(ConvertValuesToJson(values));

        Debug.Log($":: Download Table : {tableName} Complete");
    }

    // Deserialize the HTTP response
    private string[][] DeserializeResponse(string response)
    {
        return JsonConvert.DeserializeObject<GoogleSheetClass>(response).values;
    }

    // Convert the data values to a JSON string
    private string ConvertValuesToJson(string[][] values)
    {
        Dictionary<int, string> keys = new();
        List<string> jsonObjects = new List<string>();

        for (int i = 0; i < values.Length; i++)
        {
            if (i == 0)
            {
                // Set keys from the first row of values
                SetKeys(keys, values[i]);
                continue;
            }

            // Create JSON objects from subsequent rows of values
            jsonObjects.Add(GenerateJsonObject(keys, values[i]));
        }

        return $"[{string.Join(",", jsonObjects)}]";
    }

    // Set keys for JSON objects from the first row of data
    private void SetKeys(Dictionary<int, string> keys, string[] row)
    {
        for (int i = 0; i < row.Length; i++)
        {
            keys.Add(i, row[i]);
        }
    }

    // Generate a JSON object as a string
    private string GenerateJsonObject(Dictionary<int, string> keys, string[] row)
    {
        List<string> properties = new List<string>();

        for (int i = 0; i < row.Length; i++)
        {
            if (keys[i].Contains('~')) continue;

            properties.Add($"\"{keys[i]}\":\"{row[i]}\"");
        }

        return $"{{{string.Join(",", properties)}}}";
    }

    // Form URL for HTTP request
    private string PickURL(string tableName)
    {
        return string.Format(UrlFormat, KeyTable, tableName, KeyAuth);
    }

    // Inner class to match the structure of the HTTP response for deserialization
    private class GoogleSheetClass
    {
        public string range { get; set; }
        public string majorDimension { get; set; }
        public string[][] values { get; set; }
    }
}
#region Download Table
    public bool IsTableDownloaded { get; private set; } = false;
    private async void DownloadTable()
    {
        IsTableDownloaded = false;

        this._moduleDownloadTable = this.gameObject.AddComponent<ModuleDataDownloadTable>();

        var task1 = InitializeData<DataText>(Constants.PATH_DATA_TEXT, (texts) =>
        {
            _texts = texts.ToDictionary(ele => ele.idx);
        });

        var task2 = InitializeData<DataCard>(Constants.PATH_DATA_CARD, (cards) =>
        {
            _cards = cards.ToDictionary(ele => ele.idx);
            _cardsGroup = cards.GroupBy(ele => ele.group).ToDictionary(ele => ele.Key, ele => ele.ToArray());
        });

        var task3 = InitializeData<DataCardDropGroup>(Constants.PATH_DATA_CARD_DROP_GROUP, (cardDropGroups) =>
        {
            _cardDropGroup = cardDropGroups.GroupBy(ele => ele.group_idx).ToDictionary(ele => ele.Key, ele => ele.ToArray());
        });

        var task4 = InitializeData<DataCardBuyGroup>(Constants.PATH_DATA_CARD_BUY_GROUP, (cardBuyGroups) =>
        {
            _cardBuyGroup = cardBuyGroups.GroupBy(ele => ele.group_idx).ToDictionary(ele => ele.Key, ele => ele.ToArray());
        });

        await Task.WhenAll(task1, task2, task3, task4);

        IsTableDownloaded = true;
    }
    async Task InitializeData<T>(string path, System.Action<T[]> afterDeserialize)
    {
        string cleanedPath = path.Replace("Data/", "");
        var deserializedData = await Deserialize<T>(cleanedPath);
        afterDeserialize(deserializedData);
    }
    private async Task<T[]> Deserialize<T>(string path)
    {
        // Create a task completion source.
        TaskCompletionSource<T[]> tcs = new TaskCompletionSource<T[]>();

        // Start the download table task.
        StartCoroutine(_moduleDownloadTable.DownloadTable(path, (string json) =>
        {
            // Deserialize the json data to the specific object type array.
            T[] result = JsonConvert.DeserializeObject<T[]>(json);

            // Set the result to the task completion source.
            tcs.SetResult(result);
        }));

        // Await for the task to be completed.
        T[] data = await tcs.Task;

        // Return the deserialized data.
        return data;
    }
    #endregion
블로그 이미지

RIsN

,

알새우대게장밥

  • 대게장 맛이 뭔지 잘 모르겠음
  • 가성비 모름(얻어먹음)
  • 포만감 평범
  • 핫소스를 주는 이유를 알 것 같은, 심심한 맛

Version 1.2
→ Version 1.3: ???

블로그 이미지

RIsN

,

터미널을 열어서 실행

# Git LFS 설치하기
git lfs install

# 대용량 파일(TextMeshPro의 확장자가 .asset)을 Git LFS로 추적하기
git lfs track "*.asset"

# .gitattributes 파일을 Git에 추가하기
git add .gitattributes

# Git LFS migrate 명령을 사용하여 대용량 파일을 찾아서 Git LFS로 이동
git lfs migrate import --include="*.asset"

# 변경 사항 커밋하고 푸시하기
git commit -m "Start tracking large files using Git LFS"
git push

'_Diary > Dev' 카테고리의 다른 글

[Stations In Seoul] Devlog #6  (0) 2023.07.20
[Find with Seoul] Devlog #13  (0) 2023.07.20
[Stations In Seoul] Game Introduction  (0) 2023.07.13
[Stations In Seoul] Devlog #5  (0) 2023.07.13
[Find with Seoul] Devlog #12  (0) 2023.07.13
블로그 이미지

RIsN

,

update: 2023-07-13

Stations In Seoul: Rogue-lite Card Game

Download: Under Construction

Genre

  • Card + Rogue-lite

Game Introduction

  • Immerse yourself in the captivating universe of our enthralling prequel to Find with Seoul
  • This game beautifully weaves together the exciting elements of a Rogue-lite card game with a fascinating narrative that propels you on a quest for continuous development.

Game Content

  • Utilize the engrossing mechanics of a Rogue-lite card game to foster and enhance your dwelling, propelling you to ascend to unprecedented heights.
  • Dive into the vibrant world of our card collection and discover a plethora of unique and diverse cards to amplify your gaming experience.

Game Story

  • Step into the post-cyberpunk dystopia that is Seoul, a city that has drastically evolved beyond recognition. Once a bustling metropolis teeming with life, the city now finds itself grappling with a dire consequence of its own making - a rapidly burgeoning population of clones.
  • As the number of clones began to surge uncontrollably, humans were thrust into a quandary, torn between their creation and the repercussions it posed. The clones, initially a symbol of technological prowess, now represented a dystopian nightmare, forcing humans to contemplate drastic measures to regain control.
  • Left with no other viable alternatives, humanity resorted to a radical solution - banishing all clones into the bowels of the city, into the unforgiving subterranean depths. But the strategy didn't end there; in a twist of irony, humans unleashed a myriad of challenges, including the rise of zombies, within this underworld, all with a singular intention - to cull the clone population.
  • Enter this world steeped in anarchy and survive the trials laid out for you. Do you have what it takes to survive and find your place in this dystopian Seoul? The game is afoot.

Main Character Introduction

Red

  • Red
    • The commander of the next generation clone overseeing everything about the 'Seoul Reconstruction Plan'.
      Reaching her signifies the ability to make a name for oneself in the next generation.

P8

  • P8

Roadmap

Roadmap

Creator

Patreon Link

블로그 이미지

RIsN

,