UseCloud() public method

public UseCloud ( string cloudAppid, int regionIndex ) : void
cloudAppid string
regionIndex int
return void
Example #1
0
    //3a
    void SetupCloudAppIdGui()
    {
        GUILayout.Label("Your APP ID:");

        cloudAPPID = EditorGUILayout.TextField(cloudAPPID);

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Cancel"))
        {
            GUIUtility.keyboardControl = 0;
            this.ReloadHostingSettingsFromFile();
        }
        if (GUILayout.Button("Save"))
        {
            GUIUtility.keyboardControl = 0;

            ServerSetting.UseCloud(this.cloudAPPID);
            this.SavePhotonSettings();

            EditorUtility.DisplayDialog("Success", "Saved your settings.", "ok");
        }
        GUILayout.EndHorizontal();

        EditorGUILayout.Separator();

        GUILayout.Label("Running my app in the cloud was fun but...\nLet me setup my own Photon server.");

        if (GUILayout.Button("Switch to own host"))
        {
            this.photonIP    = ServerSettings.DefaultServerAddress;
            this.photonPort  = ServerSettings.DefaultMasterPort;
            photonSetupState = PhotonSetupStates._3b;
        }
    }
Example #2
0
 void Update()
 {
     if(chooseRegion){
         ConnectionUpdate();
     }else{
         VectorGui.Label("Select Region:");
         foreach(CloudServerRegion region in CloudServerRegion.GetValues(typeof(CloudServerRegion))){
             if (VectorGui.Button(region.ToString()))
             {
                 ServerSettings ss = new ServerSettings();
                 ss.UseCloud("c2bd3559-19e2-4734-88c9-fdd1d789be53", (int)region);
                 PhotonNetwork.Connect(ss.ServerAddress, ss.ServerPort, ss.AppID, "1.0");
                 chooseRegion = true;
                 break;
             }
         }
     }
     /*
     // icon renderer.
     LineRenderManager lines = GameObject.Find("LineRenderManager").GetComponent<LineRenderManager>();
     Vector2 bp = new Vector2(0,0);
     Color ourColor = Color.white;
     lines.AddCircle(new Vector3(bp.x, bp.y, 25), 20, ourColor, Time.time * 20, 3);
     lines.AddCircle(new Vector3(bp.x, bp.y, 25), 20, ourColor, 10);
     int numPoints = 25;
     int currentHealth = 25;
     for(int i=0;i<currentHealth;i++){
         float sAngle = (i/(float)(numPoints)*360.0f-Time.time*40.0f)*Mathf.Deg2Rad;
         Vector3 pa = new Vector3(Mathf.Cos(sAngle)*20+bp.x, Mathf.Sin(sAngle)*20+bp.y, 40);
         float ar = 40+((Mathf.Sin(Time.time*4.0f+i)+1.0f)*0.5f)*(40-20);
         Vector3 pb = new Vector3(Mathf.Cos(sAngle)*ar+bp.x, Mathf.Sin(sAngle)*ar+bp.y, 40);
         lines.AddLine(pa, pb, new Color(ourColor.r, ourColor.g, ourColor.b, 0.25f));
     }
     */
 }
Example #3
0
 void Start()
 {
     if(!PlayerPrefs.HasKey("Music")){
         PlayerPrefs.SetInt("Music", 1);
     }
     AudioManager.Instance.loadSoundsForLevel("lobby");
     if (!PhotonNetwork.connected)
     {
         // PhotonNetwork.ConnectUsingSettings("1.0");
         ServerSettings ss = new ServerSettings();
         ss.UseCloud("c2bd3559-19e2-4734-88c9-fdd1d789be53", (int)CloudServerRegion.US);
         PhotonNetwork.Connect(ss.ServerAddress, ss.ServerPort, ss.AppID, "1.1");
         chooseRegion = true;
     }
     // generate a name for this player, if none is assigned yet
     if (!PlayerPrefs.HasKey("PlayerName"))
     {
         playerNameBuffer = PhotonNetwork.playerName = "Guest" + Random.Range(1, 9999);
         PlayerPrefs.SetString("PlayerName", playerNameBuffer);
     }else{
         playerNameBuffer = PhotonNetwork.playerName = PlayerPrefs.GetString("PlayerName");
     }
 }