コード例 #1
0
 public void OnEvent(PlayerActionEventHandler.AnimEvent animEvent, Player sender, System.Object context)
 {
     if (animEvent == PlayerActionEventHandler.AnimEvent.eBlock && sender == match.mainRole)
     {
         OnBlock();
     }
 }
コード例 #2
0
 public void OnEvent(PlayerActionEventHandler.AnimEvent animEvent, Player sender, System.Object context)
 {
     if (sender == mainRole && animEvent == PlayerActionEventHandler.AnimEvent.eBlock)
     {
         int score = currBall.m_special ? specialBallScore : normalBallScore;
         ++myCombo;
         float bonusRatio = GameSystem.Instance.GameModeConfig.GetComboBonus(GetMatchType(), myCombo);
         m_homeScore += (int)(score * (1 + bonusRatio));
         mainRole.mStatistics.success_block_times = (uint)m_homeScore;
         uiMatch.score = m_homeScore;
         if (m_homeScore >= threeStarScore)
         {
             uiMatch.starNum  = 3;
             uiMatch.maxScore = threeStarScore;
         }
         else if (m_homeScore >= twoStarScore)
         {
             uiMatch.starNum  = 2;
             uiMatch.maxScore = threeStarScore;
         }
         else if (m_homeScore >= oneStarScore)
         {
             uiMatch.starNum  = 1;
             uiMatch.maxScore = twoStarScore;
         }
         if (myCombo > 1)
         {
             ShowCombo(myCombo);
             ShowComboBonus(bonusRatio);
         }
         blocked = true;
         HideOpportunity();
     }
 }
コード例 #3
0
 public void OnEvent(PlayerActionEventHandler.AnimEvent animEvent, Player sender, System.Object context)
 {
     if (animEvent == PlayerActionEventHandler.AnimEvent.eLayup ||
         animEvent == PlayerActionEventHandler.AnimEvent.eDunk ||
         animEvent == PlayerActionEventHandler.AnimEvent.eShoot)
     {
         OnOtherAction();
     }
 }
コード例 #4
0
	public void OnEvent(PlayerActionEventHandler.AnimEvent animEvent, Player sender, System.Object context)
	{
		if (sender == match.mainRole &&
			(animEvent == PlayerActionEventHandler.AnimEvent.eLayup ||
			 animEvent == PlayerActionEventHandler.AnimEvent.eDunk))
			OnLayupDunk();
		else if (animEvent == PlayerActionEventHandler.AnimEvent.eShoot && sender == match.mainRole)
			OnShoot();
	}
コード例 #5
0
 public void OnEvent(PlayerActionEventHandler.AnimEvent animEvent, Player sender, System.Object context)
 {
     if (animEvent == PlayerActionEventHandler.AnimEvent.eBlock)
     {
         OnFinish();
     }
     else if (animEvent == PlayerActionEventHandler.AnimEvent.eIntercepted)
     {
         OnFinish();
     }
 }
コード例 #6
0
    static int OnEvent(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 4);
        MatchState obj = (MatchState)LuaScriptMgr.GetNetObjectSelf(L, 1, "MatchState");

        PlayerActionEventHandler.AnimEvent arg0 = (PlayerActionEventHandler.AnimEvent)LuaScriptMgr.GetNetObject(L, 2, typeof(PlayerActionEventHandler.AnimEvent));
        Player arg1 = (Player)LuaScriptMgr.GetNetObject(L, 3, typeof(Player));
        object arg2 = LuaScriptMgr.GetVarObject(L, 4);

        obj.OnEvent(arg0, arg1, arg2);
        return(0);
    }
コード例 #7
0
ファイル: MatchState.cs プロジェクト: Avatarchik/LockStepDemo
 /**动作上的事件触发执行*/
 virtual public void OnEvent(PlayerActionEventHandler.AnimEvent animEvent, Player sender, System.Object context)
 {
     //Debug.Log("match state on event:" + animEvent);
     if (animEvent == PlayerActionEventHandler.AnimEvent.ePass)
     {
         UBasketball ball = m_match.mCurScene.mBall;
         if (ball.m_interceptor == null)
         {
             ball.m_catcher.m_bToCatch = true;
         }
         PlaySoundManager.Instance.PlaySound(MatchSoundEvent.PassBall);
     }
 }
コード例 #8
0
    public override void OnEvent(PlayerActionEventHandler.AnimEvent animEvent, Player sender, System.Object context)
    {
        if (m_match.m_stateMachine.m_curState != this)
        {
            return;
        }
        UBasketball ball = m_match.mCurScene.mBall;

        if (animEvent == PlayerActionEventHandler.AnimEvent.ePickupBall ||
            animEvent == PlayerActionEventHandler.AnimEvent.eRebound)
        {
            if (m_match.EnableSwitchRole())
            {
                m_match.m_ruler.SwitchRole();
            }
        }
    }
コード例 #9
0
    public override void OnEvent(PlayerActionEventHandler.AnimEvent animEvent, Player sender, System.Object context)
    {
        if (m_match.m_stateMachine.m_curState != this)
        {
            return;
        }

        UBasketball ball = m_match.mCurScene.mBall;

        if (animEvent == PlayerActionEventHandler.AnimEvent.ePickupBall ||
            animEvent == PlayerActionEventHandler.AnimEvent.eRebound)
        {
            if (animEvent == PlayerActionEventHandler.AnimEvent.eRebound)
            {
                sender.mStatistics.success_rebound_times++;
                //Debug.Log("rebound");
            }
            else
            {
                PlaySoundManager.Instance.PlaySound(MatchSoundEvent.GrabBall);
            }

            m_match.m_b24TimeUp = false;

            if (sender.m_team.m_role == GameMatch.MatchRole.eDefense ||
                sender.m_team.m_role == GameMatch.MatchRole.eNone)
            {
                if (!m_match.m_b24TimeUp)
                {
                    GameMatch.MatchRole senderTeamRole = sender.m_team.m_role;

                    if (m_match.EnableSwitchRole())
                    {
                        m_match.m_ruler.SwitchRole();
                    }

                    foreach (Player player in GameSystem.Instance.mClient.mPlayerManager)
                    {
                        player.m_enableAction = true;
                    }

                    if (senderTeamRole == GameMatch.MatchRole.eDefense && m_match.EnableCheckBall())
                    {
                        m_match.m_ruler.m_toCheckBallTeam = m_match.m_offenseTeam;
                    }

                    mRefreshCounter = false;
                    if (m_match.m_uiMatch != null && m_match.EnableCounter24())
                    {
                        m_match.m_uiMatch.ShowCounter(true, sender.m_team.m_side == Team.Side.eHome);
                        m_match.m_count24TimeStop = false;
                    }
                }
            }
        }

        if (animEvent == PlayerActionEventHandler.AnimEvent.eBlock)
        {
            sender.mStatistics.success_block_times++;
            PlaySoundManager.Instance.PlaySound(MatchSoundEvent.Block);
            PlaySoundManager.Instance.PlaySound(MatchSoundEvent.BlockBall);
        }

        if (animEvent == PlayerActionEventHandler.AnimEvent.eShoot)
        {
            bool bOpenShoot = (bool)context;
            if (bOpenShoot)
            {
                m_match.ShowPlayerTip(sender, "gameInterface_tip_shots");
            }
        }

        if (animEvent == PlayerActionEventHandler.AnimEvent.ePass)
        {
            //if( ball.m_interceptor == null )
            //    ball.m_catcher.m_bToCatch = true;
            PlaySoundManager.Instance.PlaySound(MatchSoundEvent.PassBall);
        }

        if (animEvent == PlayerActionEventHandler.AnimEvent.eIntercepted)
        {
            if (m_match.m_ruler.m_bToCheckBall && sender.m_team.m_role == GameMatch.MatchRole.eDefense)
            {
                foreach (Player player in m_match.m_ruler.m_toCheckBallTeam)
                {
                    player.m_enableAction = true;
                }
                m_match.m_ruler.m_toCheckBallTeam = null;
            }
            PlaySoundManager.Instance.PlaySound(MatchSoundEvent.InterceptSuc);
        }

        if (animEvent == PlayerActionEventHandler.AnimEvent.eDunk)
        {
            //if (m_match.m_cam != null && m_match.m_cam.m_Shake != null)
            //	m_match.m_cam.m_Shake.AddCamShake(Vector3.one * 0.2f, 0.5f, m_match.m_cam.transform.position);
        }

        if (animEvent == PlayerActionEventHandler.AnimEvent.eSteal)
        {
            //steal get ball
            if (sender.m_bWithBall)
            {
                if (m_match.m_uiMatch != null && m_match.EnableCounter24())
                {
                    m_match.m_uiMatch.ShowCounter(true, sender.m_team.m_side == m_match.m_homeTeam.m_side);
                    m_match.m_count24TimeStop = false;
                }
            }
            PlaySoundManager.Instance.PlaySound(MatchSoundEvent.StealSuc);
            sender.mStatistics.success_steal_times++;
        }

        if (animEvent == PlayerActionEventHandler.AnimEvent.eStolen)
        {
        }

        if (animEvent == PlayerActionEventHandler.AnimEvent.eCatch)
        {
            if (sender.m_defenseTarget != null)
            {
                if (sender.m_AOD.GetStateByPos(sender.m_defenseTarget.position) != AOD.Zone.eInvalid)
                {
                    m_match.ShowTips(sender.m_defenseTarget.model.head.position + Vector3.up, CommonFunction.GetConstString("MATCH_TIPS_PERFECT_DEFFENSE"), new Color32(0, 108, 0, 255));
                }
            }

            m_match.m_ruler.SetAssist(ball.m_passer, ball.m_catcher);
        }
    }