Пример #1
0
 private void SetUIGraphic()
 {
     if (uiImageType == UIImageType.Image && uiImage != null)
     {
         if (graphicType == AC_GraphicType.Normal)
         {
             uiImage.sprite = graphic.GetAnimatedSprite(true);
         }
         else if (speech != null)
         {
             uiImage.sprite = speech.GetPortraitSprite();
         }
         UpdateUIElement(uiImage);
     }
     if (uiImageType == UIImageType.RawImage && uiRawImage != null)
     {
         if (graphicType == AC_GraphicType.Normal)
         {
             uiRawImage.texture = graphic.GetAnimatedTexture(true);
         }
         else if (speech != null)
         {
             uiRawImage.texture = speech.GetPortrait();
         }
         UpdateUIElement(uiRawImage);
     }
 }
Пример #2
0
        private void SetUIGraphic()
        {
            if (uiImageType == UIImageType.Image && uiImage != null)
            {
                switch (graphicType)
                {
                case AC_GraphicType.Normal:
                    uiImage.sprite = graphic.GetAnimatedSprite(true);
                    break;

                case AC_GraphicType.DialoguePortrait:
                    if (speech != null)
                    {
                        uiImage.sprite = speech.GetPortraitSprite();
                    }
                    break;

                case AC_GraphicType.DocumentTexture:
                case AC_GraphicType.ObjectiveTexture:
                    uiImage.sprite = sprite;
                    break;

                default:
                    break;
                }
                UpdateUIElement(uiImage);
            }
            if (uiImageType == UIImageType.RawImage && uiRawImage != null)
            {
                switch (graphicType)
                {
                case AC_GraphicType.Normal:
                    if (graphic.texture != null && graphic.texture is RenderTexture)
                    {
                        uiRawImage.texture = graphic.texture;
                    }
                    else
                    {
                        uiRawImage.texture = graphic.GetAnimatedTexture(true);
                    }
                    break;

                case AC_GraphicType.DocumentTexture:
                case AC_GraphicType.ObjectiveTexture:
                    uiRawImage.texture = localTexture;
                    break;

                case AC_GraphicType.DialoguePortrait:
                    if (speech != null)
                    {
                        uiRawImage.texture = speech.GetPortrait();
                    }
                    break;
                }
                UpdateUIElement(uiRawImage);
            }
        }
Пример #3
0
 private void SetUIGraphic()
 {
     if (uiImageType == UIImageType.Image && uiImage != null)
     {
         if (graphicType == AC_GraphicType.Normal)
         {
             uiImage.sprite = graphic.GetAnimatedSprite(true);
         }
         else if (graphicType == AC_GraphicType.DocumentTexture)
         {
             uiImage.sprite = sprite;
         }
         else if (graphicType == AC_GraphicType.DialoguePortrait)
         {
             if (speech != null)
             {
                 uiImage.sprite = speech.GetPortraitSprite();
             }
         }
         UpdateUIElement(uiImage);
     }
     if (uiImageType == UIImageType.RawImage && uiRawImage != null)
     {
         if (graphicType == AC_GraphicType.Normal)
         {
             if (graphic.texture != null && graphic.texture is RenderTexture)
             {
                 uiRawImage.texture = graphic.texture;
             }
             else
             {
                 uiRawImage.texture = graphic.GetAnimatedTexture(true);
             }
         }
         else if (graphicType == AC_GraphicType.DocumentTexture)
         {
             uiRawImage.texture = localTexture;
         }
         else if (graphicType == AC_GraphicType.DialoguePortrait)
         {
             if (speech != null)
             {
                 uiRawImage.texture = speech.GetPortrait();
             }
         }
         UpdateUIElement(uiRawImage);
     }
 }
Пример #4
0
        private void DrawIcon(Vector2 offset, CursorIconBase icon, bool isLook, bool canAnimate = true)
        {
            if (icon != null)
            {
                bool isNew = false;
                if (isLook && activeLookIcon != icon)
                {
                    activeLookIcon = icon;
                    isNew          = true;
                    icon.Reset();
                }
                else if (!isLook && activeIcon != icon)
                {
                    activeIcon = icon;
                    isNew      = true;
                    icon.Reset();
                }

                if (KickStarter.cursorManager.cursorRendering == CursorRendering.Hardware)
                {
                    if (icon.isAnimated)
                    {
                        Texture2D animTex = icon.GetAnimatedTexture(canAnimate);

                        if (icon.GetName() != lastCursorName)
                        {
                            lastCursorName = icon.GetName();
                            RecordCursorTexture(animTex);

                            SetHardwareCursor(currentCursorTexture2D, icon.clickOffset);
                        }
                    }
                    else if (isNew)
                    {
                        RecordCursorTexture(icon.texture);

                        SetHardwareCursor(currentCursorTexture2D, icon.clickOffset);
                    }
                }
                else
                {
                    Texture tex = icon.Draw(KickStarter.playerInput.GetMousePosition() + offset, canAnimate);
                    RecordCursorTexture(tex);
                }
            }
        }
Пример #5
0
        private void DrawIcon(Vector2 offset, CursorIconBase icon, bool isLook)
        {
            if (icon != null)
            {
                bool isNew = false;
                if (isLook && activeLookIcon != icon)
                {
                    activeLookIcon = icon;
                    icon.Reset();
                }
                else if (!isLook && activeIcon != icon)
                {
                    activeIcon = icon;
                    isNew      = true;
                    icon.Reset();
                }

                if (KickStarter.cursorManager.cursorRendering == CursorRendering.Hardware)
                {
                    if (icon.isAnimated)
                    {
                        Texture2D animTex = icon.GetAnimatedTexture();
                        if (icon.GetName() != lastCursorName)
                        {
                            lastCursorName = icon.GetName();
                            Cursor.SetCursor(animTex, icon.clickOffset, CursorMode.Auto);
                        }
                    }
                    else if (isNew)
                    {
                        Cursor.SetCursor(icon.texture, icon.clickOffset, CursorMode.Auto);
                    }
                }
                else
                {
                    icon.Draw(KickStarter.playerInput.GetMousePosition() + offset);
                }
            }
        }
Пример #6
0
        private void DrawIcon(Vector2 offset, CursorIconBase icon, bool isLook, bool canAnimate = true)
        {
            if (icon != null)
            {
                bool isNew = false;
                if (isLook && activeLookIcon != icon)
                {
                    activeLookIcon = icon;
                    isNew = true;
                    icon.Reset ();
                }
                else if (!isLook && activeIcon != icon)
                {
                    activeIcon = icon;
                    isNew = true;
                    icon.Reset ();
                }

                if (KickStarter.cursorManager.cursorRendering == CursorRendering.Hardware)
                {
                    if (icon.isAnimated && canAnimate)
                    {
                        Texture2D animTex = icon.GetAnimatedTexture ();
                        if (icon.GetName () != lastCursorName)
                        {
                            lastCursorName = icon.GetName ();
                            Cursor.SetCursor (animTex, icon.clickOffset, CursorMode.Auto);
                        }
                    }
                    else if (isNew)
                    {
                        Cursor.SetCursor (icon.texture, icon.clickOffset, CursorMode.Auto);
                    }
                }
                else
                {
                    icon.Draw (KickStarter.playerInput.GetMousePosition () + offset, canAnimate);
                }
            }
        }