void OnJoinedRoom()
    {
        if (PhotonNetworkManager.isMasterClient == false)
        {
            return;
        }

        PhotonNetworkManager.InstantiateSceneObject("Physics Box", new Vector3(-4.5f, 5.5f, 0), Quaternion.identity, 0, null);
        PhotonNetworkManager.InstantiateSceneObject("Physics Box", new Vector3(-4.5f, 4.5f, 0), Quaternion.identity, 0, null);
        PhotonNetworkManager.InstantiateSceneObject("Physics Box", new Vector3(-4.5f, 3.5f, 0), Quaternion.identity, 0, null);

        PhotonNetworkManager.InstantiateSceneObject("Physics Box", new Vector3(4.5f, 5.5f, 0), Quaternion.identity, 0, null);
        PhotonNetworkManager.InstantiateSceneObject("Physics Box", new Vector3(4.5f, 4.5f, 0), Quaternion.identity, 0, null);
        PhotonNetworkManager.InstantiateSceneObject("Physics Box", new Vector3(4.5f, 3.5f, 0), Quaternion.identity, 0, null);
    }
예제 #2
0
    void OnClick()
    {
        if (PhotonNetworkManager.connectionStateDetailed != ClientState.Joined)
        {
            // only use PhotonNetwork.Instantiate while in a room.
            return;
        }

        switch (InstantiateType)
        {
        case 0:
            PhotonNetworkManager.Instantiate(Prefab.name, this.transform.position + 3 * Vector3.up, Quaternion.identity, 0);
            break;

        case 1:
            PhotonNetworkManager.InstantiateSceneObject(Prefab.name, InputToEvent.inputHitPos + new Vector3(0, 5f, 0), Quaternion.identity, 0, null);
            break;
        }
    }
예제 #3
0
    void OnClick()
    {
        if (!PhotonNetworkManager.inRoom)
        {
            // only use PhotonNetwork.Instantiate while in a room.
            return;
        }

        switch (InstantiateType)
        {
        case 0:
            PhotonNetworkManager.Instantiate(Prefab.name, InputToEvent.inputHitPos + new Vector3(0, 5f, 0), Quaternion.identity, 0);
            break;

        case 1:
            PhotonNetworkManager.InstantiateSceneObject(Prefab.name, InputToEvent.inputHitPos + new Vector3(0, 5f, 0), Quaternion.identity, 0, null);
            break;
        }
    }