8000 I added more options to PhotonVRManager I might change some scripts later but this is what I got. by TMTimeVR · Pull Request #45 · fchb1239/PhotonVR · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TMTimeVR
Copy link
@TMTimeVR TMTimeVR commented Sep 1, 2024

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
Copy link
Author
TMTimeVR commented Sep 18, 2024

I am adding some stuff to PhotonVRManager.

@TMTimeVR
Copy link
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
@@ -271,13 +226,36 @@ public static void SetCosmetics(Dictionary<string, string> PlayerCosmetics)
/// Sets a specefic cosmetic
/// </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)

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
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

@@ -421,6 +407,10 @@ public enum ConnectionState
Connecting,
Connected,
JoiningRoom,
InRoom
InRoom,
Error,

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

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
0