Ejemplo n.º 1
0
    private void ballMovedToTile(Ball pBall)
    {
        Player cutPlayer;

        if (isBallCut(pBall, out cutPlayer))
        {
            ApplicationFactory.instance.m_messageBus.dispatchTackleBattleStart();

            FX02 fx = ApplicationFactory.instance.m_fxManager.createFX02(cutPlayer.transform.position);
            fx.init();

            if (cutPlayer.isGK)
            {
                bool isGoal = UnityEngine.Random.RandomRange(0.0f, 1.0f) > 0.5f;

                if (isGoal)
                {
                    fx.e_end += catchGoalStart;
                }
                else
                {
                    fx.e_end += catchNoGoalStart;
                }

                m_catchInfo               = new CatchInfo();
                m_catchInfo.m_isGoal      = isGoal;
                m_catchInfo.m_catchPlayer = cutPlayer;
            }
            else
            {
                bool isPass = UnityEngine.Random.RandomRange(0.0f, 1.0f) > 0.5f;

                if (isPass)
                {
                    fx.e_end += cutPassStart;
                }
                else
                {
                    fx.e_end += cutNoPassStart;
                }

                m_cutInfo             = new CutInfo();
                m_cutInfo.m_isPass    = isPass;
                m_cutInfo.m_cutPlayer = cutPlayer;
            }
        }
        else
        {
            pBall.moveToNextSquare();
        }
    }
Ejemplo n.º 2
0
    private void currentPlayerMovedToTile(Player pPlayer)
    {
        Player tacklePlayer;

        if (isPlayerTackled(pPlayer, out tacklePlayer))
        {
            ApplicationFactory.instance.m_messageBus.dispatchTackleBattleStart();

            FX02 fx = ApplicationFactory.instance.m_fxManager.createFX02(tacklePlayer.transform.position);
            fx.init();
            fx.e_end += startPlayerTackleTo;

            bool isDribble = UnityEngine.Random.RandomRange(0.0f, 1.0f) > 0.5f;

            m_tackleInfo                 = new TackleInfo();
            m_tackleInfo.m_isDribble     = isDribble;
            m_tackleInfo.m_jumpPlayer    = pPlayer;
            m_tackleInfo.m_tacklePlayer  = tacklePlayer;
            m_tackleInfo.m_tackleToIndex = pPlayer.Index;

            if (isDribble)
            {
                if (pPlayer.isMoveEnded)
                {
                    m_tackleInfo.m_jumpToIndex = tacklePlayer.Index;
                }
                else
                {
                    m_tackleInfo.m_jumpToIndex = pPlayer.nextMoveTileIndex;
                }
            }
            else
            {
                m_tackleInfo.m_jumpToIndex = tacklePlayer.Index;
            }
        }
        else
        {
            pPlayer.moveToNextSquare();
        }
    }
Ejemplo n.º 3
0
    public FX02 createFX02(Vector3 pPosition)
    {
        FX02 fx = (GameObject.Instantiate(FX02, pPosition, Quaternion.identity) as GameObject).GetComponent <FX02>();

        return(fx);
    }