예제 #1
0
        // Update is called once per frame
        protected void FixedUpdate()
        {
            var aux = CalculatePosition();

            if (aux != _currentPosition)
            {
                _currentPosition = aux;
                SetText();
            }
        }
예제 #2
0
        // Start is called before the first frame update
        protected void Start()
        {
            if (textManager)
            {
                _textSource = textManager.transform;
                string alignment = textManager.alignment.ToString();

                if (alignment.Contains("Top"))
                {
                    _currentAlignment = PartAlignment.Top;
                }
                else if (alignment.Contains("Bottom"))
                {
                    _currentAlignment = PartAlignment.Bottom;
                }
                else if (alignment.Contains("Baseline"))
                {
                    _currentAlignment = PartAlignment.Baseline;
                }
                else if (alignment.Contains("Midline"))
                {
                    _currentAlignment = PartAlignment.Midline;
                }
                else if (alignment.Contains("Capline"))
                {
                    _currentAlignment = PartAlignment.Capline;
                }
                else
                {
                    _currentAlignment = PartAlignment.Middle;
                }

                _currentPosition = CalculatePosition();
                SetText();
            }
        }