public void Dispose() { if (mMgr != null) { mMgr.Del(this); mMgr = null; } mKind = eAudio.NONE; }
public TAudio(AudioMgr mgr, eAudio kind, GameObject obj) { mMgr = mgr; mKind = kind; if (obj != null) { mAudio = obj.GetComponent <AudioSource>(); if (mAudio == null) { mAudio = obj.AddComponent <AudioSource>(); } } }
//private static string GenerateMarcUrl(string sourceItemId) //{ // return ApiConfig.MarcUrl + sourceItemId; //} private static Displayable MapToEAudio(ElasticTitleIndex elasticProduct, Displayable displayable) { var eAudioItem = new eAudio { Narrators = elasticProduct.Narrator, Duration = Convert.ToDecimal(elasticProduct.Duration), PreviewFile = elasticProduct.PreviewFile, RecordingType = elasticProduct.RecordingType, }; Book book = (Book)eAudioItem; displayable = MapBookToDisplayable(elasticProduct, book); return(displayable); }
public TAudio Add(GameObject obj, eAudio kind) { if (obj == null) { return(null); } TAudio audio = new TAudio(this, kind, obj); if (mContainer != null) { mContainer.Add(audio); } return(audio); }