Ejemplo n.º 1
0
    public override void ConstrainMovementOnBegin(IM.Number fCurTime)
    {
        //TODO 针对PVP修改
        if (m_ruler.prepareTime < fCurTime)
        {
            return;
        }
        GrabZonePos grabZonePos = GameSystem.Instance.MatchPointsConfig.GrabZonePos;

        mainRole.position = grabZonePos.mainRole_transform.position;
        mainRole.forward  = IM.Vector3.forward;
        npc.position      = grabZonePos.npc_transform.position;
        npc.forward       = IM.Vector3.forward;
    }
Ejemplo n.º 2
0
    public override void ResetPlayerPos()
    {
        //TODO 针对PVP修改
        GrabZonePos grabZonePos = GameSystem.Instance.MatchPointsConfig.GrabZonePos;

        mainRole.position = grabZonePos.mainRole_transform.position;
        mainRole.forward  = IM.Vector3.forward;
        npc.position      = grabZonePos.npc_transform.position;
        npc.forward       = IM.Vector3.forward;

        if (mCurScene.balls.Count == 0)
        {
            for (int i = 0; i < 5; ++i)
            {
                UBasketball ball = mCurScene.CreateBall();
                ball.onShoot     += OnShoot;
                ball.onShootGoal += OnGoal;
                ball.onDunk      += OnDunk;
            }
        }
        for (int i = 0; i < 5; ++i)
        {
            UBasketball ball = mCurScene.balls[i];
            if (ball.m_owner != null)
            {
                ball.m_owner.DropBall(ball);
            }
            IM.Vector3 tempPos = grabZonePos.balls_transform[i].position;
            tempPos.y = ball.m_ballRadius;
            ball.SetInitPos(tempPos);
            ball.m_ballState = BallState.eLoseBall;
        }

        zonePosition = new IM.Vector3[ZONE_COUNT + 1];
        for (int i = 0; i < ZONE_COUNT; ++i)
        {
            zonePosition[i] = grabZonePos.zones_transform[i].position;
        }
    }