Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        private void WaitForAssetInstance(AssetWidget assetWidget)
        {
            assetWidget.OnAssetInstanced.RemoveListener(delegate { WaitForAssetInstance(assetWidget); });

            SetContent(assetWidget.Asset.audio);

            if (sound && !source.isPlaying && playOnStart)
            {
                FadeIn(fadeDuration);
            }
        }
Esempio n. 4
0
        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); });
            }
        }
Esempio n. 5
0
 public override void Initialize(AssetWidget assetWidget)
 {
     base.Initialize(assetWidget);
     this.type   = Type.Asset;
     initialized = true;
 }
Esempio n. 6
0
 public virtual void Initialize(AssetWidget assetWidget)
 {
     base.Initialize();
     m_assetWidget = assetWidget;
 }