Photon Unity Turn based Multiplayer game

I am trying to create a simple 2D Turn based multiplayer game using Photon Unity Networking. It is just a simple turn based game where a player 1(host) presses his button and it adds his score and changes its turn to player 2(client) who presses his button to add score and change turn to player 1. It continues to infinite. I was able to connect two players in the game using the basic Photon documentation. Now I need to add the networking logic of taking turns and changing them. I searched the internet but I can’t understand the RPC and SerializeView of Photon. I am really confused with that. Please Help me. Thank you in future. Here is my GameManager Script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class GameManager : Photon.PunBehaviour
{    
    public Text roomName;
    public Text player1Name,player2Name;
    public List<string> playersConnected = new List<string>();
    int scoreP1 = 0, scoreP2 = 0;
    public Text scoreTextP1, scoreTextP2;
    public Button p1Btn, p2Btn;
    int playerTurn = 1;

    void Start()
    {
        roomName.text = SceneManager.GetActiveScene().name;
        p2Btn.gameObject.SetActive(false);
        p1Btn.gameObject.SetActive(true);

    }    

    public void AddScoreP1()
    {
        scoreP1++;
        scoreTextP1.text = scoreP1.ToString();
        ChangePlayerTurn();
    }


    public void AddScoreP2()
    {
        scoreP2++;
        scoreTextP2.text = scoreP2.ToString();
        ChangePlayerTurn();
    }

    void ChangePlayerTurn()
    {
        if (playerTurn == 1)
        {
            playerTurn = 2;
            p2Btn.gameObject.SetActive(true);
            p1Btn.gameObject.SetActive(false);
        }
        else
        {
            playerTurn = 1;
            p1Btn.gameObject.SetActive(true);
            p2Btn.gameObject.SetActive(false);
        }
        print("Player Turn: P" + playerTurn);
    }

    void LoadArena()
    {
        if (!PhotonNetwork.isMasterClient)
        {
            Debug.LogError("PhotonNetwork : Trying to Load a level but we are not the master Client");
        }
        Debug.Log("PhotonNetwork : Loading Level : " + PhotonNetwork.room.PlayerCount);
        PhotonNetwork.LoadLevel("Room for " + PhotonNetwork.room.PlayerCount);
    }

    public override void OnLeftRoom()
    {
        SceneManager.LoadScene(0);
    }      

    public void LeaveRoom()
    {
        PhotonNetwork.LeaveRoom();
    }

    public override void OnPhotonPlayerConnected(PhotonPlayer other)
    {
        Debug.Log("OnPhotonPlayerConnected() " + other.NickName); // not seen if you're the player connecting
        foreach (PhotonPlayer _player in PhotonNetwork.playerList)
        {
            playersConnected.Add(other.NickName);
        }

        if (PhotonNetwork.isMasterClient)
        {
            Debug.Log("OnPhotonPlayerConnected isMasterClient " + PhotonNetwork.isMasterClient); // called before OnPhotonPlayerDisconnected


            LoadArena();
        }
    }

    public override void OnPhotonPlayerDisconnected(PhotonPlayer other)
    {
        Debug.Log("OnPhotonPlayerDisconnected() " + other.NickName); // seen when other disconnects
        foreach (PhotonPlayer _player in PhotonNetwork.playerList)
        {
            playersConnected.Remove(other.NickName);
        }

        if (PhotonNetwork.isMasterClient)
        {
            Debug.Log("OnPhotonPlayerDisonnected isMasterClient " + PhotonNetwork.isMasterClient); // called before OnPhotonPlayerDisconnected
            LoadArena();
        }
    }


}

Hi @SaintTippu,

there is a PunTurnManager in package you have downloaded from the Asset Store. I guess using this or taking at least a look at this will help you for the turn based behaviour.

RPCs are remote procedure calls which are invoked on one client to process a function on the same object on all remote clients. Therefore you have to use the RPC function on an attached PhotonView component and also have to register a function which is called. This function requires the [PunRPC] attribute. To see how RPCs are working I recommend you taking a look at the RPCs and RaiseEvent documentation page.

OnPhotonSerializeView only works if there are two or more players in the room. OnPhotonSerializeView provides a continuing data exchange between the clients and their objects and is called 20 times per second by default. To use this, you have to implement the function yourself and add the script as an observed component to the also attached PhotonView component. Since your game is turn based and not realtime, I guess you don’t have to use OnPhotonSerializeView for now.