C# Game Programming Cookbook for Unity 3D / Программирование игр на Unity 3D C#. Книга готовых решений.: 8.1.1 Разбор скрипта
| Английский оригинал | Перевод на русский | |
|---|---|---|
Сожалеем, но текст оригинала доступен только зарегистрированным пользователям. |
||
|
using UnityEngine; ilia1395 25.10.14 в 21:18 |
||
|
public void PlaySound(Vector3 atPosition) ilia1395 25.10.14 в 21:30 |
||
|
public class BaseSoundController : MonoBehavior ilia1395 25.10.14 в 21:30 |
||
|
public void Awake() ilia1395 25.10.14 в 21:30 |
||
|
Mac OS X: ~LibraryPreferencesUnityWebPlayerPrefs ilia1395 25.10.14 в 21:36 |
||
|
// we will grab the volume from PlayerPrefs when this script ilia1395 25.10.14 в 21:36 |
||
|
soundObjectList=new ArrayList(); ilia1395 25.10.14 в 21:36 |
||
|
foreach(AudioClip theSound in GameSounds) ilia1395 25.10.14 в 21:37 |
||
|
tempSoundObj= new SoundObject(theSound, ilia1395 25.10.14 в 21:37 |
||
|
totalSounds++; ilia1395 25.10.14 в 21:37 |
||
|
public void PlaySoundByIndex(int anIndexNumber, Vector3 aPosition) ilia1395 25.10.14 в 21:37 |
||
|
if(anIndexNumber>soundObjectList.Count) ilia1395 25.10.14 в 21:38 |
||
|
A temporary AudioClip is made to hold the required sound as it is played with ilia1395 25.10.14 в 21:38 |
||
|
tempSoundObj= (SoundObject)soundObjectList[anIndexNumber]; ilia1395 25.10.14 в 21:38 |
||
