protected override void SetupAsLocalPlayer() { base.SetupAsLocalPlayer(); GameplayStatics.Log("RemoteOP setup as local player, my Type: " + NetPlayerSetting.Instance.MyType); // Initialize remote operator parameters m_Camera.tag = "MainCamera"; Camera.SetupCurrent(m_Camera); }
protected override void SetupAsRemotePlayer() { base.SetupAsRemotePlayer(); GameplayStatics.Log("Surgeon setup as remote player, my Type: " + NetPlayerSetting.Instance.MyType); // Destroy local component Destroy(m_VRGO); Destroy(GetComponent <OVRDebugInfo>()); }
protected override void SetupAsRemotePlayer() { base.SetupAsRemotePlayer(); GameplayStatics.Log("RemoteOP setup as remote player, my Type: " + NetPlayerSetting.Instance.MyType); // Destroy local component Destroy(m_Camera.gameObject); Destroy(m_CanvasObj); }
protected override void SetupAsLocalPlayer() { base.SetupAsLocalPlayer(); GameplayStatics.Log("Surgeon setup as local player, my Type: " + NetPlayerSetting.Instance.MyType); // 1. Main Camera m_MainCam.tag = "MainCamera"; // 2. Destroy Remote Component // Destroy local player's Mesh and the sync camera comp Destroy(m_LHandTr_Remote.GetChild(0).gameObject); Destroy(m_RHandTr_Remote.GetChild(0).gameObject); Destroy(m_Camera_Remote.GetComponent <Camera>()); Destroy(m_AvatarDisplay); }
public void StartSimulation() { // Only Remote operator can start game. if (!m_bGameStart) { if (NetPlayerSetting.Instance.MyType == PlayerType.RemoteOP) { PV.RPC("RPC_StartSimulation", RpcTarget.AllBuffered); } else { GameplayStatics.Log("Start Game Fail because wrong player type, myType: " + NetPlayerSetting.Instance.MyType); } } else { GameplayStatics.Log("Start Game Fail because game has already started"); } }
public virtual void StartSimulation() { // Set up local behaviours GameplayStatics.Log(name + " starts simulation!"); }
void RPC_ReceiveType(int i_myType) { myType = (PlayerType)i_myType; m_bMyTypeReceived = true; GameplayStatics.Log("Received My Type: " + myType); }
void RPC_SendType(int i_myType) { PV.RPC("RPC_ReceiveType", RpcTarget.OthersBuffered, (int)i_myType); GameplayStatics.Log("Send My Type: " + i_myType); }