public override void Initialize(AssetWidget assetWidget) { if (!assetWidget) { Debug.LogWarning(this.name + " [Initializing with Null AssetWidget]"); return; } base.Initialize(assetWidget); if (assetWidget.Asset.isLoaded) { waitingOnAsset = false; SetContent(assetWidget.Asset.texture); if (m_display && !waitingOnDisplay) { UpdateDisplay(); } } else { waitingOnAsset = true; assetWidget.OnAssetInstanced.AddListener(OnAssetReady); } }
private void OnDisplayAssetReady(AssetWidget displayAsset) { waitingOnDisplayAsset = false; displayAsset.OnAssetInstanced.RemoveListener(delegate { OnDisplayAssetReady(displayAsset); }); var model = displayAsset.GetComponents <AssetHandlerWidget>().FirstOrDefault(w => w is IModelWidget); SetDisplay(model); }
private void WaitForAssetInstance(AssetWidget assetWidget) { assetWidget.OnAssetInstanced.RemoveListener(delegate { WaitForAssetInstance(assetWidget); }); SetContent(assetWidget.Asset.audio); if (sound && !source.isPlaying && playOnStart) { FadeIn(fadeDuration); } }
public override void Initialize(AssetWidget assetWidget) { if (assetWidget.Asset != null && assetWidget.Asset.audio) { SetContent(assetWidget.Asset.audio); Initialize(); if (sound && !source.isPlaying && playOnStart) { FadeIn(fadeDuration); } } else { Initialize(); assetWidget.OnAssetInstanced.AddListener(delegate { WaitForAssetInstance(assetWidget); }); } }
public override void Initialize(AssetWidget assetWidget) { base.Initialize(assetWidget); this.type = Type.Asset; initialized = true; }
public virtual void Initialize(AssetWidget assetWidget) { base.Initialize(); m_assetWidget = assetWidget; }