Ejemplo n.º 1
0
    public void onPlayingEnded()      //After one play End, (one Shoot)
    {
        if (Player.player_type == PLAYER_TYPE.MASTER || Player.player_type == PLAYER_TYPE.AI || Player.player_type == PLAYER_TYPE.STANDALONE)
        {
            Player.Should_change(myBuffer); //check all in here.
            if (Player.win != 0)            //Game End (Win or Lose)
            {
                GamePlayUI.instance.GameEnd();
            }
            if (Player.IsNet())
            {
                GetComponent <PhotonView>().RPC("PlayingEndedRPC", PhotonTargets.OthersBuffered, myBuffer.GetCurrentFrame().GetString(), Player.turn_change, Player.ball_type.ToString(), Player.win, Player.foul);
            }
        }
        else if (Player.player_type == PLAYER_TYPE.SLAVE && is_ended)
        {
//			print ("Slave Play End");
            EndPlaying(str_packet_temp, turn_change_temp, str_balltype_temp, win_or_lose_temp, foul_temp);
        }

        Player.shotpower_type    = SHOTPOWER_TYPE.LITTLE;
        is_playing               = false;
        cueController.clock_left = cueController.clock_right = Constant.play_time;
        //should be changed
        if (Player.player_type != PLAYER_TYPE.AI)
        {
            cueController.EnableBoosts();
        }
    }