包含11節(jié)視頻教程
從零基礎(chǔ)學(xué)習(xí)unity3d游戲引擎,簡單易學(xué)的視頻教程,讓你快速掌握unity3d,并喜歡上游戲開發(fā)的樂趣。
![]()
|
![]() Text Assets are a format for imported text files. When you drop a text file into your Project Folder, it will be converted to a Text Asset. The supported text formats are: 文本資源是導(dǎo)入的文本文件的一個格式。當(dāng)你拖入一個文本文件到你的項目時,他會被轉(zhuǎn)換為文本資源。支持的文本格式有:
Properties 屬性
Details 細節(jié)The Text Asset is a very specialized use case. It is extremely useful for getting text from different text files into your game while you are building it. You can write up a simple .txt file and bring the text into your game very easily. It is not intended for text file generation at runtime. For that you will need to use traditional Input/Output programming techniques to read and write external files. 文本資源是一個非常專業(yè)的使用情況。他通常用于從不同的文本文件中得到文本到你的游戲中當(dāng)你編譯他時。你可以寫一個簡單的.txt文件并且很容易的把文本帶入到你的游戲中去。其目的不是在運行時生成文本文件。為此,你需要使用傳統(tǒng)的輸入/輸出的編程技術(shù)來讀取和寫入外部文件。 Consider the following scenario. You are making a traditional text-heavy adventure game. For production simplicity, you want to break up all the text in the game into the different rooms. In this case you would make one text file that contains all the text that will be used in one room. From there it is easy to make a reference to the correct Text Asset for the room you enter. Then with some customized parsing logic, you can manage a large amount of text very easily. 請考慮下面的情形。你正在做一個傳統(tǒng)的文字冒險游戲。為了制作簡單,你想把游戲中的文本分解到不同的房間。在這種情況下,你會制作出一個文本他包含了所有將會在一個房間里使用的文本。從那里你很容易為你輸入的房間引用正確的文本資源。然后使用一些自定義的分析邏輯,這樣你可以很輕松的管理大量的文本。 Binary data 二進制數(shù)據(jù)A special feature of the text asset is that it can be used to store binary data. By giving a file the extension .bytes it can be loaded as a text asset and the data can be accessed through the bytes property. 文本資源的一個特色是,他可以用來存儲二進制數(shù)據(jù)。文件以.bytes作為擴展名,并且可以被作為一個文本資源進行加載,而且數(shù)據(jù)可以通過bytes屬性進行訪問。 For example put a jpeg file into the Resources folder and change the extension to .bytes, then use the following script code to read the data at runtime: 例如放一個jpeg的文件到Resources文件夾里,并且修改他的屬性為.bytes,然后使用如下的腳本代碼在運行時讀取數(shù)據(jù):
Hints 提示
贊0 踩0 |
未知用戶
2005-2025 朱峰社區(qū) 版權(quán)所有 遼ICP備2021001865號-1
2005-2025 ZhuFeng Community All Rights Reserved
VIP