Ejemplo n.º 1
0
    public void TossTop()
    {
        Toss();
        Animator anim = TopTosser.GetComponent <Animator>();

        anim.SetTrigger("Toss");
        SendTossTrigger(TopTosser);
        Ball.position = TopTosser.position;

        BallController.CreateDestination(TopServer.position);

        //
        SetCanPlayersMove(false);
        TopServer.GetComponent <NetworkClientController>()._canserve = true;
    }
Ejemplo n.º 2
0
    private void Kick(bool isServeKick, float power, float intel)
    {
        if (_isKicking && sepakBall.IsInRange(1.5f))
        {
            if (sepakBall.IsSpecialActive)
            {
                sepakBall.SetSpecial(false);
            }

            if (sepakBall.IsSpecial)
            {
                sepakBall.SetSpecialActive(true);
            }
            else
            {
                sepakBall.speed = power;
            }

            if (transform.parent.name.Contains("player1"))
            {
                if (sepakBall.IsSpecial)
                {
                    sepakBall.CreateDestination(PlayerHost.GeneralControl.TopServer.position);
                    PlayerHost.Server.GameSession.Player1SpecialThreshold = 0f;
                }
                else
                {
                    sepakBall.MoveToTop();
                }

                if (isServeKick)
                {
                    PlayerHost.GeneralControl.EnablePlayersMovement();
                }
                else if (!sepakBall.IsSpecial)
                {
                    PlayerHost.GeneralControl.AddPlayer1Threshold(intel);
                }
            }
            else
            {
                if (sepakBall.IsSpecial)
                {
                    sepakBall.CreateDestination(PlayerHost.GeneralControl.BottomServer.position);
                    PlayerHost.Server.GameSession.Player2SpecialThreshold = 0f;
                }
                else
                {
                    sepakBall.MoveToBottom();
                }

                if (isServeKick)
                {
                    PlayerHost.GeneralControl.EnablePlayersMovement();
                }
                else if (!sepakBall.IsSpecial)
                {
                    PlayerHost.GeneralControl.AddPlayer2Threshold(intel);
                }
            }
        }
    }