public void OnClick() { NetworkIdentity netID = NetworkClient.connection.identity; playerCtrlr = netID.GetComponent <My_PlayerController>(); playerCtrlr.CmdDrawCard(3); }
public void RpcSetTurn() { isOurTurn = !isOurTurn; Debug.Log("isOurTurn: ---- " + isOurTurn); turn_button.gameObject.SetActive(isOurTurn); if (isOurTurn) { // playerController = My_PlayerController.localPlayer; // playerController.CmdDrawCard(1); NetworkIdentity netID = NetworkClient.connection.identity; My_PlayerController p = netID.GetComponent <My_PlayerController>(); p.CmdDrawCard(1); p.addMana(); } }
public void startGame(bool hostFirst) { // My_PlayerController player = My_PlayerController.localPlayer; // to set thing on current player isOurTurn = true; turn_button.gameObject.SetActive(true); if (!hostFirst) { CmdEndTurn(); //playerController.CmdDrawCard(1); return; } else { NetworkIdentity netID = NetworkClient.connection.identity; My_PlayerController p = netID.GetComponent <My_PlayerController>(); p.CmdDrawCard(1); } }