コード例 #1
0
ファイル: Arrow.cs プロジェクト: DacodaDragon/SwipeSwipeMania
        public void UpdatePosition(float deltaTime)
        {
            float   a = Vector2DMath.GetAngle(direction);
            Vector2 f = Vector2DMath.AngleToVector(a + (ArrowBehaviorData.Instance.Rotation * EffectModifier) * Mathf.Abs(deltaTime));

            transform.localPosition = f * (deltaTime);
            //transform.rotation = Quaternion.Euler(0,0,0);
            //float x = Mathf.Clamp(4-Mathf.Abs(deltaTime*4),0f, 4f)/4;
            //transform.localScale = new Vector3(x, x, x);
        }
コード例 #2
0
        private void TouchEnd()
        {
            if (!m_tracking)
            {
                return;
            }

            Vector2 touchEndPos = m_listener.GetPreviousTouchPosition();
            float   angle       = Vector2DMath.GetAngleBetween(m_TouchBeginPos, touchEndPos);

            m_OnDirectionalSwipe?.Invoke(AngleToDirection(angle));
            m_tracking = false;
        }