Esempio n. 1
0
        /**
         * <summary>Draws the element using OnGUI</summary>
         * <param name = "_style">The GUIStyle to draw with</param>
         * <param name = "_slot">Ignored by this subclass</param>
         * <param name = "zoom">The zoom factor</param>
         * <param name = "isActive">If True, then the element will be drawn as though highlighted</param>
         */
        public override void Display(GUIStyle _style, int _slot, float zoom, bool isActive)
        {
            base.Display(_style, _slot, zoom, isActive);

            switch (graphicType)
            {
            case AC_GraphicType.Normal:
                if (graphic != null)
                {
                    graphic.DrawAsInteraction(ZoomRect(relativeRect, zoom), true);
                }
                break;

            case AC_GraphicType.DialoguePortrait:
                if (localTexture)
                {
                    if (speechIsAnimating)
                    {
                        if (portraitCharacterOverride)
                        {
                            speechRect = portraitCharacterOverride.GetAnimatedPortraitRect();
                        }
                        else if (speech != null)
                        {
                            speechRect = speech.GetAnimatedRect();
                        }
                        GUI.DrawTextureWithTexCoords(ZoomRect(relativeRect, zoom), localTexture, speechRect);
                    }
                    else
                    {
                        GUI.DrawTexture(ZoomRect(relativeRect, zoom), localTexture, ScaleMode.StretchToFill, true, 0f);
                    }
                }
                break;

            case AC_GraphicType.DocumentTexture:
            case AC_GraphicType.ObjectiveTexture:
                if (localTexture)
                {
                    GUI.DrawTexture(ZoomRect(relativeRect, zoom), localTexture, ScaleMode.StretchToFill, true, 0f);
                }
                break;
            }
        }