Esempio n. 1
0
        /**
         * <summary>Performs all calculations necessary to display the element.</summary>
         * <param name = "_slot">Ignored by this subclass</param>
         * <param name = "languageNumber">The index number of the language to display text in</param>
         * <param name = "isActive">If True, then the element will be drawn as though highlighted</param>
         */
        public override void PreDisplay(int _slot, int languageNumber, bool isActive)
        {
            switch (graphicType)
            {
            case AC_GraphicType.DialoguePortrait:
                UpdateSpeechLink();
                if (speech != null)
                {
                    localTexture      = speech.GetPortrait();
                    speechIsAnimating = speech.IsAnimating();
                }
                break;

            case AC_GraphicType.DocumentTexture:
                if (Application.isPlaying && KickStarter.runtimeDocuments.ActiveDocument != null)
                {
                    if (localTexture != KickStarter.runtimeDocuments.ActiveDocument.texture)
                    {
                        Texture2D docTex = KickStarter.runtimeDocuments.ActiveDocument.texture;
                        sprite = UnityEngine.Sprite.Create(docTex, new Rect(0f, 0f, docTex.width, docTex.height), new Vector2(0.5f, 0.5f));
                    }
                    localTexture = KickStarter.runtimeDocuments.ActiveDocument.texture;
                }
                break;
            }

            SetUIGraphic();
        }
        /**
         * <summary>Performs all calculations necessary to display the element.</summary>
         * <param name = "_slot">Ignored by this subclass</param>
         * <param name = "languageNumber">The index number of the language to display text in</param>
         * <param name = "isActive">If True, then the element will be drawn as though highlighted</param>
         */
        public override void PreDisplay(int _slot, int languageNumber, bool isActive)
        {
            if (graphicType == AC_GraphicType.DialoguePortrait)
            {
                UpdateSpeechLink();
                if (speech != null)
                {
                    speechTex         = speech.GetPortrait();
                    speechIsAnimating = speech.IsAnimating();
                }
            }

            SetUIGraphic();
        }
Esempio n. 3
0
        public override void PreDisplay(int _slot, int languageNumber, bool isActive)
        {
            if (graphicType == AC_GraphicType.DialoguePortrait)
            {
                UpdateSpeechLink();
                if (speech != null)
                {
                    speechTex         = speech.GetPortrait();
                    speechIsAnimating = speech.IsAnimating();
                }
            }

            if (uiImage != null)
            {
                if (graphicType == AC_GraphicType.Normal)
                {
                    uiImage.sprite = graphic.GetAnimatedSprite(true);
                }
                else if (speech != null)
                {
                    uiImage.sprite = speech.GetPortraitSprite();
                }
                UpdateUIElement(uiImage);
            }
        }