/// <summary>
 /// Fill out all the information stored and disable unnessercary code.
 /// </summary>
 void Awake()
 {
     if (FindObjectsOfType(GetType()).Length > 1)
     {
         Destroy(gameObject);
     }
     if (steamManager == null)
     {
         steamManager = GameObject.Find("SteamManager");
     }
     if (issteamversion == false)
     {
         Debug.Log("setupoculus");
         if (steamManager)
         {
             steamManager.SetActive(false);
         }
     }
     FleetBuilder = IORoot.findIO("fleet1");
     FleetBuilder.read();
     crosslevelholder           = GameObject.Find("MainMenuHolder").GetComponent <MainMenuValueHolder>();
     steamManager               = GameObject.Find("SteamManager");
     stkman                     = GetComponent <VRTK_SDKManager>();
     stkman.LoadedSetupChanged += new VRTK_SDKManager.LoadedSetupChangeEventHandler(Load);
     if (FleetBuilder.get <bool>("LeftMode"))
     {
         GameObject lefthand = stkman.scriptAliasLeftController;
         stkman.scriptAliasLeftController  = stkman.scriptAliasRightController;
         stkman.scriptAliasRightController = lefthand;
         FleetBuilder.read();
     }
 }
    /// <summary>
    /// Loads up the lobby level and starts boot up progress to begin the mission.
    /// </summary>
    /// <param name="map">the selected map.</param>
    void loadcampaignactual(int map)
    {
        MainMenuValueHolder valhol = GameObject.Find("MainMenuHolder").GetComponent <MainMenuValueHolder>();

        valhol.campaign         = true;
        valhol.selectedcampaign = maps[map + (countthrough * 4)];
        GameObject.Find("Controllers").GetComponent <GalaxyController>().findagame();
    }
Exemplo n.º 3
0
    /// <summary>
    /// A function that repeats every second to check games status.
    /// </summary>
    void refreshrep()
    {
        if (PhotonNetwork.connectedAndReady)
        {
            PhotonVoiceNetwork.Connect();
            if (steammangercheck.issteamversion == true && SteamFriends.GetFriendCount(EFriendFlags.k_EFriendFlagAll) > 0)
            {
                getfriendslist();
            }
            if (PhotonNetwork.playerName != null)
            {
                namedisplaytext.text = "Player Name: " + PhotonNetwork.playerName;
            }
            if (steammangercheck.issteamversion == false)
            {
                steamconnectiontext.text = "Oculus Connected";
            }
            else
            {
                steamconnectiontext.text = "SteamConnection: " + SteamAPI.IsSteamRunning().ToString();
            }
            refresh();
        }
        else if (PhotonNetwork.connectionStateDetailed != ClientState.JoinedLobby)
        {
            counter++;
            if (counter == 3)
            {
                PhotonNetwork.ConnectUsingSettings("1.0");
                counter = 0;
            }
        }
        statustext.text = "status: " + PhotonNetwork.connectionStateDetailed;
        MainMenuValueHolder manvalueholder  = GameObject.Find("MainMenuHolder").GetComponent <MainMenuValueHolder>();
        MainMenuValueHolder manvalueholder2 = GameObject.Find("MainMenuHolder").GetComponent <MainMenuValueHolder>();

        if ((manvalueholder.testarea == true || manvalueholder.tutorial == true || manvalueholder.campaign == true))
        {
            Loading.SetActive(true);
        }
        if ((manvalueholder.testarea == true || manvalueholder.tutorial == true || manvalueholder.campaign == true) && joinedyet == false)
        {
            joinedyet = true;
            onevone();
            Debug.Log("1v1");
        }
    }
Exemplo n.º 4
0
    /// <summary>
    /// Search initalisation stuff.
    /// </summary>
    void Start()
    {
        MainMenuValueHolder manvalueholder = GameObject.Find("MainMenuHolder").GetComponent <MainMenuValueHolder>();

        Loading.SetActive(false);
        if (manvalueholder.testarea == false && manvalueholder.tutorial == false && manvalueholder.campaign == false)
        {
            PhotonNetwork.offlineMode = false;
            PhotonNetwork.ConnectUsingSettings("1.0");
        }
        GameObject.Find("MainMenuHolder").GetComponent <MainMenuValueHolder>().currentlyloading = false;
        steammangercheck = GameObject.Find("VRTK_SDK").GetComponent <VRTK_SDK_CONTROLLER_MANAGER>();
        // phop = istrans.GetComponent<PhotonVoiceRecorder>();
        statustext      = status.GetComponent <TextMesh>();
        ping            = PhotonNetwork.networkingPeer.RoundTripTime;
        namedisplaytext = namedisplay.GetComponent <TextMesh>();
        InvokeRepeating("refreshrep", 0, 1);

        foreach (GameObject match in MultiplayerMatchDisplay)
        {
            matchtext.Add(match.GetComponent <TextMesh>());
        }
        Debug.Log("running?");
        pingtext    = pingdisplay.GetComponent <TextMesh>();
        pagenumtext = pagenumdisplay.GetComponent <TextMesh>();
        for (int i = 0; i < 5; i++)
        {
            backgroundrend[i] = background[i].GetComponent <MeshRenderer>();
        }
        creategamecontrol.SetActive(false);
        creategamecontrolprivate.SetActive(false);
        steamconnectiontext = steamconnectionthing.GetComponent <TextMesh>();
        if ((manvalueholder.testarea == true || manvalueholder.tutorial == true || manvalueholder.campaign == true))
        {
            Loading.SetActive(true);
        }
    }