Unity Спеціальні теки

2075 / Unity / 2D / 3D / Спеціальні теки

Assets
Editor
Editor Default Resources
Gizmos


Resources
1. Програти звук

sound1 = Resources.Load<AudioClip>("Win");
sound1.PlayOneShot(); // відтворити

2. Завантажити світлину

Sprite sprite = Resources.Load("Skin1", typeof(Sprite)) as Sprite;
GetComponent<SpriteRenderer>().sprite = sprite;

3. Завантажити текст з файлу

TextAsset txtData=(TextAsset)Resources.Load("TextFile");
string txt = txtData.text;


Standard Assets
StreamingAssets
Hidden Assets