예제 #1
0
        private void OnHitedImp(Vector2 speedV, Transform tsf)
        {
            if (m_InLertPoPos || m_InBeatBackState)
            {
                return;
            }
            BaseBullet bullet = tsf.GetComponent <BaseBullet>();

            if (bullet)
            {
                m_BackStartSpeed = bullet.GetBackStartSpeed();
                m_BackEndSpeed   = bullet.GetBackEndSpeed();
                m_BackTime       = bullet.GetBackTime();
            }
            else
            {
                Monster monster = tsf.GetComponent <Monster>();
                m_BackStartSpeed = monster.GetBackStartSpeed();
                m_BackEndSpeed   = monster.GetBackEndSpeed();
                m_BackTime       = monster.GetBackTime();
            }
            if (m_BackTime > 0)
            {
                m_CurTime         = 0;
                m_SpeedVec2       = speedV;
                m_G               = 2 * m_V0 / (m_BackTime * 0.4f);
                m_InBeatBackState = true;
                m_Player.SetSpeed(Vector2.zero);
            }
            else
            {
                m_Player.EndBackAct();
            }
        }
예제 #2
0
        private void OnHitedImp(Vector2 speedV, Transform bulletTsf)
        {
            BaseBullet bullet = bulletTsf.GetComponent <BaseBullet>();

            m_SpeedVec2      = speedV;
            m_CurTime        = 0;
            m_BackStartSpeed = bullet.GetBackStartSpeed();
            m_BackEndSpeed   = bullet.GetBackEndSpeed();
            //if(m_BackStartSpeed == 0 && m_BackEndSpeed == 0)
            //{
            //    m_Monster.SetAbsAnimSpeed(0);
            //    m_Monster.SetStaticByRigidProp();
            //}
            m_BackTime = Mathf.Max(bullet.GetBackTime(), 0.01f);
            m_StartAct = true;
        }