Skip to content

I added more options to PhotonVRManager I might change some scripts later but this is what I got.#45

Closed
TMTimeVR wants to merge 1 commit into
fchb1239:mainfrom
TMTimeVR:patch-1
Closed

I added more options to PhotonVRManager I might change some scripts later but this is what I got.#45
TMTimeVR wants to merge 1 commit into
fchb1239:mainfrom
TMTimeVR:patch-1

Conversation

@TMTimeVR

@TMTimeVR TMTimeVR commented Sep 1, 2024

Copy link
Copy Markdown

Disclaimer

Fchb1239 please check my code if it works. I'm not perfect at coding.

There might be some bugs in the code. Please have mercy with me.

I tested it in my game and it worked.

I only edited PhotonVRManager so just copy and paste this into your PhotonVRManager.

Stuff I added

I added a dev region choice. Meaning if your apk is a development build, it's going to connect to the dev region.

        [Tooltip("The region that people connect to if the apk is a development build (check your build settings).")]
        public string DevRegion = "";

I also added a Offline mode bool. Meaning that it simulates an online connection. PUN can be used as if it was in an online connection.

        [Tooltip("Simulates an online connection.\nPUN can be used as usual.")]
        public bool StartInOfflineMode = false;

I also also added more connection states for more debugging.

    public enum ConnectionState
    {
        Disconnected,
        Connecting,
        Connected,
        JoiningRoom,
        InRoom,
        Error,
        Generating_Roomcode,
        Switching_Scenes,
        Setting_Up_Settings
    }

I just basically made it more easy so you don't have to go manually into the Photon server settings and just be able to control Photon from one script.

@TMTimeVR
TMTimeVR marked this pull request as draft September 18, 2024 13:46
@TMTimeVR

TMTimeVR commented Sep 18, 2024

Copy link
Copy Markdown
Author

I am adding some stuff to PhotonVRManager.

@TMTimeVR

Copy link
Copy Markdown
Author

I also also ALSO added a TMP that you can assign and it will say what's going on.

        [Tooltip("Basically a tmp that says what PhotonVRManager is doing.")]
        public static TextMeshPro LogText;
            if (Manager == null)
            {
                Manager = this;
                Manager.State = ConnectionState.Setting_Up_Settings;
                LogText.text = "Setting Up Settings..."; //Here
                PhotonNetwork.PhotonServerSettings.DevRegion = DevRegion;
            }
            else if (StartInOfflineMode == true)
            {
                PhotonNetwork.PhotonServerSettings.StartInOfflineMode = true;
            }
            else if (StartInOfflineMode == false)
            {
                PhotonNetwork.PhotonServerSettings.StartInOfflineMode = false;
            }
            else
            {
                Debug.LogError("There can't be multiple PhotonVRManagers in a scene");
                Manager.State = ConnectionState.Error;
                LogText.text = "ERROR: There can't be multiple PhotonVRManagers in a scene."; //Also here
                Application.Quit();
            }

@TMTimeVR
TMTimeVR marked this pull request as ready for review September 18, 2024 14:48
Comment thread PhotonVRManager.cs
/// </summary>
/// <param name="Type">The type of cosmetic you want to set</param>
public static void SetCosmetic(string Type, string CosmeticId)
public static void SetCosmetic(CosmeticType Type, string CosmeticId)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this entire function should never have been changed

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that was bc I changed photon vr version 0.0.5 or 0.0.4

Comment thread PhotonVRManager.cs
JoiningRoom,
InRoom
InRoom,
Error,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the cases under the error case are just not needed

@TMTimeVR

Copy link
Copy Markdown
Author

This pull request is pretty old. I will create a new one in a few days (or hours) where I fix the bugs in my code.

@TMTimeVR TMTimeVR closed this Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants