예제 #1
0
    public void OnLostBall()
    {
        PlayerState_Stolen stolenState = _owner.m_StateMachine.m_curState as PlayerState_Stolen;

        if (stolenState != null)
        {
            stolenState.OnLostBall();
        }
        else
        {
            _owner.OnLostBall();
        }
    }
예제 #2
0
    public void OnSteal()
    {
        if (m_success)
        {
            if (!m_bGetBall)
            {
                stealTarget.m_lostBallContext.vInitPos   = m_ball.position;
                stealTarget.m_lostBallContext.vInitPos.y = IM.Math.Max(m_ball.position.y, m_player.position.y + new IM.Number(0, 300));
                stealTarget.m_lostBallContext.vInitVel   = m_player.right.normalized;
            }

            PlayerState_Stolen stolen = stealTarget.m_StateMachine.GetState(State.eStolen) as PlayerState_Stolen;
            stolen.m_bLostBall = !m_bGetBall;
            stealTarget.m_StateMachine.SetState(stolen);
        }

        /*
         * if(m_bGetBall)
         * {
         *      stealTarget.DropBall(m_ball);
         *      m_player.GrabBall(m_ball);
         *
         *      m_player.m_eventHandler.NotifyAllListeners(UPlayerActionEventHandler.AnimEvent.ePickupBall);
         *
         *      AudioClip clip = AudioManager.Instance.GetClip("Misc/Catch_02");
         *      if( clip != null )
         *              AudioManager.Instance.PlaySound(clip);
         * }
         */

        if (m_success)
        {
            m_player.eventHandler.NotifyAllListeners(PlayerActionEventHandler.AnimEvent.eSteal);
        }

        m_player.mStatistics.SkillUsageSuccess(m_curExecSkill.skill.id, m_success);

        if (onSteal != null)
        {
            onSteal();
        }
    }