TextAsset myTextAsset = Resources.Load("myTextFile"); string fileContents = myTextAsset.text; Debug.Log(fileContents);
AssetBundle bundle = AssetBundle.LoadFromFile("myAssetBundle"); TextAsset myTextAsset = bundle.LoadAssetIn this example, we load an asset bundle from a file and then load a text asset named "myTextFile" from the bundle using the LoadAsset method of the AssetBundle object. Package library: UnityEngine("myTextFile"); string fileContents = myTextAsset.text; Debug.Log(fileContents);
Text file assets.