Esempio n. 1
0
        /// <summary>
        /// Stops all active portrait tweens.
        /// </summary>
        public static void StopPortraitTweens()
        {
            // Stop all tweening portraits
            var activeCharacters = Character.ActiveCharacters;

            for (int i = 0; i < activeCharacters.Count; i++)
            {
                var c = activeCharacters[i];
                if (c.State.portraitGraphic != null)
                {
                    if (LeanTween.isTweening(c.State.portraitGraphic.gameObject))
                    {
                        LeanTween.cancel(c.State.portraitGraphic.gameObject, true);
                        PortraitGraphic.SetRectTransform(c.State.portraitGraphic.rectTransform, c.State.position);
                        if (c.State.dimmed == true)
                        {
                            c.State.portraitGraphic.SetColor(new Color(0.5f, 0.5f, 0.5f, 1f));
                        }
                        else
                        {
                            c.State.portraitGraphic.SetColor(Color.white);
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        protected virtual void SetupPortrait(PortraitOptions options)
        {
            PortraitGraphic.SetRectTransform(options.character.State.portraitGraphic.rectTransform, options.fromPosition);

            if (options.character.State.facing != options.character.PortraitsFace)
            {
                options.character.State.portraitGraphic.rectTransform.localScale = new Vector3(-1f, 1f, 1f);
            }
            else
            {
                options.character.State.portraitGraphic.rectTransform.localScale = new Vector3(1f, 1f, 1f);
            }

            if (options.facing != options.character.PortraitsFace)
            {
                options.character.State.portraitGraphic.rectTransform.localScale = new Vector3(-1f, 1f, 1f);
            }
            else
            {
                options.character.State.portraitGraphic.rectTransform.localScale = new Vector3(1f, 1f, 1f);
            }

            options.character.State.portraitGraphic.SetPortrait(options.portrait);
        }