Esempio n. 1
0
    private void Awake()
    {
        animator      = GetComponent <Animator>();
        targets       = new List <GameObject>();
        senseCollider = GetComponent <SphereCollider>();
        topText       = GetComponentInChildren <TopText>();
        spawner       = GameObject.Find("Spawner").GetComponent <Spawner>();

        currentState = EntityState.Idle;
    }
 public object Clone()
 {
     return(new LyricTemplate()
     {
         TopText = TopText.Clone() as FormattedText,
         MainText = TopText.Clone() as FormattedText,
         BottomText = TopText.Clone() as FormattedText,
         TranslateText = TopText.Clone() as FormattedText,
         TranslateTextColor = TranslateTextColor
     });
 }
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = TopText != null?TopText.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (MainText != null ? MainText.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (BottomText != null ? BottomText.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (TranslateText != null ? TranslateText.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ TranslateTextColor.GetHashCode();
                hashCode = (hashCode * 397) ^ Scale.GetHashCode();
                return(hashCode);
            }
        }
        public WindowShare Setting(ISettingsWindow wind)
        {
            Settings = wind;

            if (!Settings.IsNull() && !Settings.ColorWindowView.IsNullOrWhiteSpace())
            {
                WindowView?.SetBackgroundColor(Settings?.ColorWindowView);
            }

            if (!Settings.IsNull() && !Settings.ColorContentView.IsNullOrWhiteSpace())
            {
                if (Settings.Round)
                {
                    ContentView?.SetBackgroundColor(Settings?.ColorContentView, 5);
                }
                else
                {
                    ContentView?.SetBackgroundColor(Settings?.ColorContentView);
                }
            }

            if (!Settings.IsNull() && !Settings.ColorCentreView.IsNullOrWhiteSpace())
            {
                CentreView?.SetBackgroundColor(Settings?.ColorCentreView);
            }

            if (!Settings.IsNull() && !Settings.ColorText.IsNullOrWhiteSpace())
            {
                TopText?.SetTextColor(Settings?.ColorText);
            }

            if (!Settings.IsNull() && !Settings.ColorText.IsNullOrWhiteSpace())
            {
                BottomText?.SetTextColor(Settings?.ColorText);
            }

            if (!Settings.IsNull() && !Settings.ColorCentreText.IsNullOrWhiteSpace())
            {
                CentreText?.SetTextColor(Settings?.ColorCentreText);
            }


            return(this);
        }
Esempio n. 5
0
        public override void GetCaretInfo(ref HCCaretInfo aCaretInfo)
        {
            if (FActiveArea != ExpressArea.ceaNone)
            {
                OwnerData.Style.ApplyTempStyle(TextStyleNo);

                switch (FActiveArea)
                {
                case ExpressArea.ceaLeft:
                    if (FCaretOffset < 0)
                    {
                        FCaretOffset = 0;
                    }

                    aCaretInfo.Height = FLeftRect.Bottom - FLeftRect.Top;
                    aCaretInfo.X      = FLeftRect.Left + OwnerData.Style.TempCanvas.TextWidth(FLeftText.Substring(0, FCaretOffset));
                    aCaretInfo.Y      = FLeftRect.Top;
                    break;

                case ExpressArea.ceaTop:
                    if (FCaretOffset < 0)
                    {
                        FCaretOffset = 0;
                    }

                    aCaretInfo.Height = TopRect.Bottom - TopRect.Top;
                    aCaretInfo.X      = TopRect.Left + OwnerData.Style.TempCanvas.TextWidth(TopText.Substring(0, FCaretOffset));
                    aCaretInfo.Y      = TopRect.Top;
                    break;

                case ExpressArea.ceaRight:
                    if (FCaretOffset < 0)
                    {
                        FCaretOffset = 0;
                    }

                    aCaretInfo.Height = FRightRect.Bottom - FRightRect.Top;
                    aCaretInfo.X      = FRightRect.Left + OwnerData.Style.TempCanvas.TextWidth(FRightText.Substring(0, FCaretOffset));
                    aCaretInfo.Y      = FRightRect.Top;
                    break;

                case ExpressArea.ceaBottom:
                    if (FCaretOffset < 0)
                    {
                        FCaretOffset = 0;
                    }

                    aCaretInfo.Height = BottomRect.Bottom - BottomRect.Top;
                    aCaretInfo.X      = BottomRect.Left + OwnerData.Style.TempCanvas.TextWidth(BottomText.Substring(0, FCaretOffset));
                    aCaretInfo.Y      = BottomRect.Top;
                    break;
                }
            }
            else
            {
                aCaretInfo.Visible = false;
            }
        }