Ejemplo n.º 1
0
        private void Update()
        {
            if (_NavElement == null)
            {
                return;
            }

            if (!DeusaldSharp.MathUtils.AreFloatsEquals(_PreviousExtraOffset, _ExtraOffset))
            {
                _NavElement.ExtraOffset = _ExtraOffset;
                _PreviousExtraOffset    = _ExtraOffset;
            }

            float rotation = transform.rotation.eulerAngles.z * Mathf.Deg2Rad;

            if (!DeusaldSharp.MathUtils.AreFloatsEquals(_PreviousRotation, rotation))
            {
                _NavElement.Rotation = rotation;
                _PreviousRotation    = rotation;
            }

            Vector2 position = _Transform.position;

            if (_PreviousPosition != position)
            {
                _NavElement.Position = MainNav2D.ToVec2(position);
                _PreviousPosition    = position;
            }
        }
Ejemplo n.º 2
0
        private void RefreshPoints(object sender, EventArgs eventArgs)
        {
            DeusaldSharp.Vector2[] points = _NavElement.NavElementPoints;
            _Points = new Vector2[points.Length];

            for (int i = 0; i < _Points.Length; ++i)
            {
                _Points[i] = MainNav2D.ToVec2(points[i]);
            }
        }